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

skip_final_snapshot=false causes destroy failure #74

Open
razorsedge opened this issue Sep 21, 2020 · 3 comments
Open

skip_final_snapshot=false causes destroy failure #74

razorsedge opened this issue Sep 21, 2020 · 3 comments
Labels
bug 🐛 An issue with the system

Comments

@razorsedge
Copy link

Describe the Bug

When skip_final_snapshot = false, running terraform destroy fails to delete the RDS option group.

Expected Behavior

Terraform destroy should not fail. If skip_final_snapshot = false, then this module should not attempt to destroy aws_db_option_group.default.

Steps to Reproduce

  1. Configure the basic example confirming that parameter skip_final_snapshot = false.
  2. terraform apply
  3. terraform destroy
  4. See error

Screenshots

If applicable, add screenshots or logs to help explain your problem.

$ terraform destroy
[snip]
module.database.aws_db_option_group.default[0]: Still destroying... [id=rds-default, 14m31s elapsed]
module.database.aws_db_option_group.default[0]: Still destroying... [id=rds-default, 14m41s elapsed]
module.database.aws_db_option_group.default[0]: Still destroying... [id=rds-default, 14m51s elapsed]

Error: Error Deleting DB Option Group: InvalidOptionGroupStateFault: The option group 'rds-default' cannot be deleted because it is in use.
	status code: 400, request id: 9f1a4a8a-5e45-4add-aaa6-df3612e44b4e


Releasing state lock. This may take a few moments...

Environment (please complete the following information):

  • Terraform: v0.12.29
  • provider.aws v2.70.0

Additional Context

RDS will not delete the DB option group because the final snapshot references it. If the final snapshot is deleted, the DB option group can be removed. This is not a Terraform problem, but how RDS works.

@razorsedge razorsedge added the bug 🐛 An issue with the system label Sep 21, 2020
@jamengual
Copy link

@razorsedge have you tried setting the module with enabled = false and then run terraform apply?

@razorsedge
Copy link
Author

@jamengual I have not. And I am not clear on why I would when I want to destroy the entire configuration, not disable it.

@jamengual
Copy link

I was wondering if it could have differently but I do not think it will now that I think about it.

@razorsedge We are happy to receive PRs so feel free to create one ands send it over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants