the module doesn't permit to do read replicate
This kind of resource should be enough to do an RDS read replicate ...
resource "aws_db_instance" "db_replica_main_postgresql" {
instance_class = "db.${var.rds_main_postgres_instance_type}"
skip_final_snapshot = true
backup_retention_period = 7
replicate_source_db = module.db_main_postgres.db_identifier
}
But the module demands a "freetext" to create a "db_name" and an "engine_version" ...
They shouldn't be required when "replicate_source_db" is given
Without "freetext" :
╷
│ Error: Missing required argument
│
│ on rds-main-postgres.tf line 88, in module "db_replica_main_postgresql":
│ 88: module "db_replica_main_postgresql" {
│
│ The argument "freetext" is required, but no definition was found.
╵
Without "engine_version"
╷
│ Error: Missing required argument
│
│ on rds-main-postgres.tf line 88, in module "db_replica_main_postgresql":
│ 88: module "db_replica_main_postgresql" {
│
│ The argument "engine_version" is required, but no definition was found.
╵
With "freetext" and "engine_version"
╷
│ Error: Conflicting configuration arguments
│
│ with module.db_replica_main_postgresql[1].aws_db_instance.postgresql_instance,
│ on .terraform/modules/db_replica_main_postgresql/main.tf line 39, in resource "aws_db_instance" "postgresql_instance":
│ 39: db_name = replace("dbiaas-${local.identifier}", "-", "")
│
│ "db_name": conflicts with replicate_source_db
╵