terraform-aws-rds-cluster
terraform-aws-rds-cluster copied to clipboard
Can't create an Aurora RDS Global Cluster from a snapshot
Describe the Bug
Aurora Global Cluster cannot be created using this module if a snapshot_identifier is specified. This will instead return an error like this:
Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Error: Conflicting configuration arguments
│
│ with module.db_cluster.aws_rds_cluster.secondary[0],
│ on .terraform/modules/db_cluster/main.tf line 181, in resource "aws_rds_cluster" "secondary":
│ 181: snapshot_identifier = var.snapshot_identifier
│
│ "snapshot_identifier": conflicts with global_cluster_identifier
Digging into it further, Terraform official docs for the AWS provider call this out:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster#snapshot_identifier https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster#global-cluster-restored-from-snapshot
There needs to be a special path for this specific use case, where a cluster is first created from the snapshot and then joins a global cluster.
Expected Behavior
I would specify a snapshot via the snapshot_identifier variable and create a new Aurora Global Cluster from the snapshot.
Steps to Reproduce
Set both snapshot_identifier and global_cluster_identifier and terraform apply up the module.
Screenshots
No response
Environment
No response
Additional Context
No response