Cannot recreate database instance due to create_before_destroy
set to true
on the cluster instance
#257
Labels
bug
🐛 An issue with the system
Describe the Bug
Hi all.
The use-cases where the database has to be recreated from a snapshot, results in an error due to a conflicting name.
I noticed that
create_before_destroy = true
is on both of these resourcesThe second
aws_rds_cluster_parameter_group
and thirdaws_db_parameter_group
ones correctly has the option to either usename
orname_prefix
which can avoid the recreation issue, but the firstaws_rds_cluster_instance
only usesidentifier
without an option to useidentifier_prefix
.terraform-aws-rds-cluster/main.tf
Lines 349 to 351 in d13a56c
terraform-aws-rds-cluster/main.tf
Lines 404 to 408 in d13a56c
terraform-aws-rds-cluster/main.tf
Lines 429 to 433 in d13a56c
Even if the flag
identifier_prefix
was set to presumably avoid this naming conflict issue, the flagcreate_before_destroy = true
for these resources doesn't make sense to me since if the old database was going to be destroyed, creating a brand new one wouldn't prevent an outage. Is this flag really providing value?Two ways to solve this and both solutions could also be employed
identifier_prefix
foraws_rds_cluster_instance
create_before_destroy = true
flag for these resourcesExpected Behavior
Recreation without naming conflict
Steps to Reproduce
You should see the error now
Screenshots
N/A
Environment
terraform 1.11.0
module v1.18.0
Additional Context
create_before_destroy
flag foraws_db_parameter_group
and there is no equivalent foraws_rds_cluster_instance
but one can predict if there was, it would most likely recommendidentifier_prefix
.The text was updated successfully, but these errors were encountered: