terraform-aws-rds-cluster
terraform-aws-rds-cluster copied to clipboard
Second destroy will fail if snapshot is not skipped due to snapshot conflict
Found a bug? Maybe our Slack Community can help.
Describe the Bug
If the cluster is created and destroyed and then created again and attempted a destroy again, the last destroy will fail because there is a snapshot with the same name as the last one.
│ Error: error deleting RDS Cluster (aurora-example-shared): DBClusterSnapshotAlreadyExistsFault: Cannot create the cluster snapshot because one with the identifier aurora-example-shared already exists.
Expected Behavior
Add a random id to the final snapshot when the cluster is created to avoid conflicts
Can we get this resolved? It would be good to give control of this value.
final_snapshot_identifier = var.cluster_identifier == "" ? lower(module.this.id) : lower(var.cluster_identifier)
maybe with...
final_snapshot_identifier = coalesce(var.final_snapshot_identifier, var.cluster_identifier == "" ? lower(module.this.id) : lower(var.cluster_identifier))
...
variable "final_snapshot_identifier" {
default = ""
}