diff --git a/rds-postgres/replica/README.md b/rds-postgres/replica/README.md index f7b4189..996a762 100644 --- a/rds-postgres/replica/README.md +++ b/rds-postgres/replica/README.md @@ -48,6 +48,7 @@ Provision a Postgres database configured as a replica using AWS RDS. | [parameter\_group\_name](#input\_parameter\_group\_name) | Name of the RDS parameter group; defaults to identifier | `string` | `""` | no | | [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Set to false to disable performance insights | `bool` | `true` | no | | [publicly\_accessible](#input\_publicly\_accessible) | Set to true to access this database outside the VPC | `bool` | `false` | no | +| [replica\_region](#input\_replica\_region) | Region where the replica will be managed; defaults to the provider region when null | `string` | `null` | no | | [replicate\_source\_db](#input\_replicate\_source\_db) | Identifier of the primary database instance to replicate | `string` | n/a | yes | | [storage\_encrypted](#input\_storage\_encrypted) | Set to false to disable on-disk encryption | `bool` | `true` | no | | [subnet\_group\_name](#input\_subnet\_group\_name) | Name of the RDS subnet group (only for cross-region replication) | `string` | `null` | no | diff --git a/rds-postgres/replica/main.tf b/rds-postgres/replica/main.tf index 1ede48c..c32464b 100644 --- a/rds-postgres/replica/main.tf +++ b/rds-postgres/replica/main.tf @@ -10,6 +10,7 @@ resource "aws_db_instance" "this" { parameter_group_name = local.parameter_group_name performance_insights_enabled = var.performance_insights_enabled publicly_accessible = var.publicly_accessible + region = var.replica_region replicate_source_db = var.replicate_source_db skip_final_snapshot = true storage_encrypted = var.storage_encrypted diff --git a/rds-postgres/replica/variables.tf b/rds-postgres/replica/variables.tf index b9635fb..a3562e0 100644 --- a/rds-postgres/replica/variables.tf +++ b/rds-postgres/replica/variables.tf @@ -59,6 +59,12 @@ variable "replicate_source_db" { type = string } +variable "replica_region" { + description = "Region where the replica will be managed; defaults to the provider region when null" + type = string + default = null +} + variable "storage_encrypted" { type = bool default = true