Open rutujachaudhari124 opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @rutujachaudhari124 👋 Thank you for taking the time to raise this! So that we have the information needed to look into this, can you supply a sample Terraform configuration as well?
have you tried to specify database_name it implicitly ?
aws_rds_global_cluster = {
***************** = {
global_cluster_identifier = "*************"
deletion_protection = false
database_name = "database04"
force_destroy = true
source_db_cluster_identifier = "*************"
}
}
have you tried to specify database_name it implicitly ?
aws_rds_global_cluster = { ***************** = { global_cluster_identifier = "*************" deletion_protection = false database_name = "database04" force_destroy = true source_db_cluster_identifier = "*************" } }
@Kristin0 We have tested this case where we have added the database_name as "database04", in this case we got an error that the database_name should not be specified as it will be inherited from source cluster. The error is mentioned below:
@justinretzolk Updated the terraform configuration.
@justinretzolk any updates?
Looking into similar issue mentioned here #15177 it seems the database_name parameter requires to have computed=true (regional has it: https://github.com/hashicorp/terraform-provider-aws/blob/v4.46.0/internal/service/rds/cluster.go#L122, global does not: https://github.com/hashicorp/terraform-provider-aws/blob/v4.46.0/internal/service/rds/global_cluster.go#L48)
same issue with these versions:
Terraform Core Version
v1.3.3
AWS Provider Version
v4.46.0
Having this same issue. Has anyone had any luck?
We are have a similar issue with aurora global cluster for postgres built out of a snapshot. With is_promoted_global_cluster = true, global cluster gets correctly setup with database_name that is identical to regional cluster but upon subsequent apply instead of detecting no changes to infrastructure - terraform is noticing database_name getting updated from current database_name to null which forces replacement of global cluster.
-/+ resource "aws_rds_global_cluster" "global_cluster_promoted" {
~ arn = "arn:aws:rds::******:global-cluster:****" -> (known after apply)
- database_name = "*****" -> null # forces replacement
~ engine = "aurora-postgresql" -> (known after apply)
~ engine_version = "13.6" -> (known after apply)
~ engine_version_actual = "13.6" -> (known after apply)
~ global_cluster_members = [
- {
- db_cluster_arn = "arn:aws:rds:us-east-1:*******:cluster:********"
- is_writer = false
},
- {
- db_cluster_arn = "arn:aws:rds:us-west-2:*******:cluster:********"
- is_writer = true
},
] -> (known after apply)
~ global_cluster_resource_id = "cluster-3d909f38d460f47e" -> (known after apply)
~ id = "********" -> (known after apply)
~ storage_encrypted = true -> (known after apply)
# (4 unchanged attributes hidden)
}
Plan: 1 to add, 0 to change, 1 to destroy.
If you try to apply it fails with following error
Error: error removing RDS DB Cluster (arn:aws:rds:us-west-2:******:cluster:********) from Global Cluster (******): InvalidParameterValue: Can not remove writer cluster when there are other clusters
│ status code: 400, request id: 1c891562-958e-4ae0-a7ce-3a6cc0dcdb22
If you don't have a secondary cluster or destroy secondary cluster and run apply it will still recreate global cluster but at this time apply doesn't fail and it will succesfully complete. However, re-running apply still show same issue about global cluster needs to be recreated.
Any updates...this is blocking all subsequent updates to the project that includes global cluster spread across multiple regions.
@justinretzolk - any idea on when this will get address? It is blocking all updates to the project that include other resources.
+1 to this. We are currently experiencing this bug.
Hey y'all 👋 Thank you for checking in on this! Unfortunately I can't provide an ETA on when this will be looked into due to the potential of shifting priorities. We prioritize by count of :+1: reactions and a few other things (more information on our prioritization guide if you're interested).
Hi all,
I faced the same issue, I used this workarround, hope that could work also with you
resource "aws_rds_global_cluster" "example" {
...
lifecycle {
ignore_changes = [database_name]
}
}
I used ignore_changes to database_name as workaround to mitigate issue. Forgot to mention it here.
Terraform Core Version
0.12.31
AWS Provider Version
3.70.0
Affected Resource(s)
aws_rds_global_cluster
Expected Behavior
Subsequent apply should show no changes and no force replacement.
Actual Behavior
The subsequent apply shows a diff for the database_name parameter since this value is inherited from source cluster configuration and the applied configuration contains N/A value for this parameter.
Plan: 1 to add, 0 to change, 1 to destroy.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
terraform apply terraform plan
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
This github issue is similar issue for 'storage_encrypted' parameter in this same resource. https://github.com/hashicorp/terraform-provider-aws/issues/15177
Would you like to implement a fix?
None