Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_db_instance terminates blue_green_update due to storage-initialization state #36650

Closed
Indigenuity opened this issue Mar 6, 2025 · 1 comment
Labels
bug new new issue not yet triaged

Comments

@Indigenuity
Copy link

Terraform Version

Terraform v1.9.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.63.0

Terraform Configuration Files

resource "aws_db_instance" "example_db" {
  # this is being changed via blue_green_update
  parameter_group_name    = "new-parameter-group"

  # DB with "db.t4g.medium" here has succeeded. This one fails to update
  instance_class          = "db.m5.xlarge"
  
  engine                  = "postgres"
  db_name                 = "testdb"
  identifier              = "example-db"
  
  allocated_storage       = 100
  publicly_accessible     = false
  storage_type            = "gp2"
  vpc_security_group_ids = [aws_security_group.example.id]
  skip_final_snapshot     = true
  blue_green_update {
    enabled = true
  }
}

Debug Output

Error: updating RDS DB Instance (example-db): creating Blue/Green Deployment: waiting for Green environment: unexpected state 'storage-initialization', wanted target 'available, storage-optimization'. last error: %!s(<nil>)

Expected Behavior

Terraform should anticipate the storage-initialization state after creation of the "green" side of the deploy. It is an expected and documented state during blue/green deploys. Not all instance types will trigger the state. T-family instances will skip initialization, thus they don't trigger this bug.

Actual Behavior

Immediately following the creation of the "green" instance, terraform sees the storage-initialization state and begins deletion of the blue_green_update.

Steps to Reproduce

  1. terraform init
  2. terraform apply
  3. Change parameter group name
  4. terraform apply

Additional Context

This PR may have already solved the issue, but it needs reviewing and merging.

Note that this bug is NOT a duplicate of storage-optimization issues like this one. That usually refers to changes in storage_type, whereas this is strictly related to lazy-loading after restoration from backups (which are utilized in blue/green).

References

hashicorp/terraform-provider-aws#41275

Generative AI / LLM assisted development?

No response

@Indigenuity Indigenuity added bug new new issue not yet triaged labels Mar 6, 2025
@Indigenuity
Copy link
Author

Apologies, I opened this in the wrong repo. I'll create one in the AWS provider repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

1 participant