Overview
An Aurora Global Database spans multiple AWS Regions, with a single primary cluster handling writes and one or more secondary clusters providing low-latency reads close to geographically distributed users. Replication from primary to secondary typically occurs in under a second. Use a global cluster when you need:- Disaster recovery — promote a secondary cluster to primary within minutes if a regional outage occurs.
- Global read performance — serve read traffic locally from the region nearest to your users.
- Write forwarding — allow secondary clusters to forward write operations back to the primary without application-level routing changes.
Setup Order
Create the global cluster resource
The
aws_rds_global_cluster resource defines the shared engine, version, and encryption settings. Both the primary and secondary modules reference this resource.Create the primary cluster
The primary cluster is a normal Aurora cluster that references the global cluster via
global_cluster_identifier. Set is_primary_cluster = true (the default) so the module creates a writer instance and accepts master_username.Global clusters do not support
manage_master_user_password. You must supply the master password directly using master_password_wo.Create the secondary cluster
The secondary cluster sets The
is_primary_cluster = false, which prevents the module from creating a writer instance or setting a master username. It inherits its data via replication from the primary.Set source_region to the primary cluster’s region when using encrypted storage — this is required for Aurora to establish cross-region replication of encrypted clusters.depends_on block ensures the primary cluster is fully provisioned before the secondary cluster attempts to join the global database.Complete Working Example
The following is the full example fromexamples/global-cluster/, provisioning a primary in eu-west-1 and a secondary in us-east-1:
Lifecycle Considerations
The module’saws_rds_cluster resource includes a lifecycle block that ignores changes to both global_cluster_identifier and replication_source_identifier after initial creation:
Write Forwarding
To allow a secondary cluster to forward writes back to the primary without application changes, setenable_global_write_forwarding = true on the secondary module:
Variable Reference
| Variable | Type | Default | Description |
|---|---|---|---|
global_cluster_identifier | string | null | The identifier of the aws_rds_global_cluster to join |
is_primary_cluster | bool | true | Set to false for secondary clusters — disables writer instance creation and master_username |
source_region | string | null | Source region for encrypted cross-region replication |
replication_source_identifier | string | null | ARN of a source DB cluster or instance (for read replicas) |
enable_global_write_forwarding | bool | null | Allow secondary cluster to forward writes to the primary |

