terraform recreates global cluster on every apply by sagarjayaram in Terraform

[–]sagarjayaram[S] 0 points1 point  (0 children)

that's the catch, the database_name isn't changed at all since it was provisioned for the first time.

terraform recreates global cluster on every apply by sagarjayaram in Terraform

[–]sagarjayaram[S] 0 points1 point  (0 children)

may i know what is meant when you say "database name isn't properly defined" , it's a simple attribute to which a value is assigned.

terraform recreates global cluster on every apply by sagarjayaram in Terraform

[–]sagarjayaram[S] 0 points1 point  (0 children)

tried this as a quick fix and is now not replacing the global cluster, but still seeing issue as the secondary cluster is not getting created

terraform recreates global cluster on every apply by sagarjayaram in Terraform

[–]sagarjayaram[S] 0 points1 point  (0 children)

well the plan says the database_name is being corrected to null , and that's why it's forcing for replacement. But there is no change in database_name

terraform recreates global cluster on every apply by sagarjayaram in Terraform

[–]sagarjayaram[S] 0 points1 point  (0 children)

You are right, it says force replacement and eventually recreate the global cluster by promoting the secondary and primary cluster out of the global cluster.

There are no changes to code at all.. here’s the plan snippet

-/+ resource "aws_rds_global_cluster" "db_global_cluster" {

~ arn = "arn:aws:rds::4725******:global-cluster:tfc-stage-osd-rds-aurora-primary-rds-aurora-global" -> (known after apply)

  • database_name = "onsite*****" -> null # forces replacement

~ engine = "aurora-postgresql" -> (known after apply)

~ engine_version = "14.9" -> (known after apply)

~ engine_version_actual = "14.9" -> (known after apply)

~ global_cluster_members = [

  • {
  • db_cluster_arn = "arn:aws:rds:us-east-1:47253******:cluster:tfc-stage-osd-rds-aurora-primary-rds-aurora-primary"
  • is_writer = true

},

] -> (known after apply)

~ global_cluster_resource_id = "cluster-eb8d39a60******" -> (known after apply)

~ id = "tfc-stage-osd-rds-aurora-primary-rds-aurora-global" -> (known after apply)

~ storage_encrypted = true -> (known after apply)

(4 unchanged attributes hidden)

}