hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

Reexamine the default enabling of RDS auto_minor_version_upgrade setting due to high likelihood of Terraform state clashes #26801

Open gygitlab opened 2 years ago

gygitlab commented 2 years ago

Community Note

Description

Currently in the Terraform module auto_minor_version_upgrade is set to true for RDS instances. However this is very likely going to cause problems and is a Terraform "sniff" as the state of the database is being changed outside of Terraform and will cause clashes whenever a user has specified a specific version of the database:

β”‚ Error: updating RDS DB Instance (test-rds): InvalidParameterCombination: Cannot upgrade postgres from 12.11 to 12.10
β”‚   status code: 400
β”‚ 
β”‚   with module.aws_db_instance.gitlab[0],
β”‚   on ../terraform/modules/rds/rds.tf line 47, in resource "aws_db_instance" "rds":
β”‚   47: resource "aws_db_instance" "rds" {

With Terraform it's strongly not recommended to have the state change outside of it. In this case should this behaviour not be disabled by default?

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_db_instance" "rds" {
  engine                    = "postgres"
  engine_version      = "12.10"

  # allow_major_version_upgrade = true
}

References

github-actions[bot] commented 1 week ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!