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_parameter_group deletion issue when modifying aws_db_instance(db_engine_version) #2222

Closed
vijay-veeranki opened this issue Aug 13, 2020 · 2 comments

Comments

@vijay-veeranki
Copy link
Contributor

vijay-veeranki commented Aug 13, 2020

At the moment when user try to change the "aws_db_instance(db_engine_version)" from 10 to 11 for example they have to change the "rds_family" to postgres10 to postgres11.

rds family is defined with in the resource "aws_db_parameter_group"

https://github.com/ministryofjustice/cloud-platform-terraform-rds-instance/blob/main/main.tf#L131-L142

To apply this change terraform is trying to delete and recreate the aws_db_parameter_group and failing with error.

Error: Error deleting DB parameter group: InvalidDBParameterGroupState: One or more database instances are still members of this parameter group cloud-platform-xxxxxxx, so the group cannot be deleted.

There is a open issue regarding this.
hashicorp/terraform-provider-aws#6448

The work around for this is:

Login to the AWS Console, modify the RDS and set Parameter group to the default.postgres10 group provided by AWS
re-run the terraform apply
The parameter group will get deleted and new one will be created and get assigned to the RDS.
The RDS will now continue to change the db_engine_version to 11.

This involves manual steps, so identify a solution to find out a better solution.

May be users need to create 2 PR's one to set the parameter group to default one and later set it back to right ones?

@vijay-veeranki vijay-veeranki changed the title Identify a solution for modifying aws_db_instance(db_engine_version) and delete aws_db_parameter_group issue Identify a solution for modifying aws_db_instance(db_engine_version) aws_db_parameter_group deletion issue Aug 13, 2020
@vijay-veeranki vijay-veeranki changed the title Identify a solution for modifying aws_db_instance(db_engine_version) aws_db_parameter_group deletion issue Identify a solution for aws_db_parameter_group deletion issue when modifying aws_db_instance(db_engine_version) Aug 13, 2020
@vijay-veeranki vijay-veeranki changed the title Identify a solution for aws_db_parameter_group deletion issue when modifying aws_db_instance(db_engine_version) aws_db_parameter_group deletion issue when modifying aws_db_instance(db_engine_version) Aug 13, 2020
@AntonyBishop
Copy link
Contributor

Perhaps we should ask AWS for any recommendations?

@mtrbls
Copy link
Contributor

mtrbls commented Oct 29, 2020

Tested with manual change from the CLI, instead of AWS console change.
This is only possible with the newly added permission.

@mtrbls mtrbls closed this as completed Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants