Terraform: Intermittent aws_db_instance & aws_db_option_group lifecycle issues

Created on 24 Jun 2016  ยท  3Comments  ยท  Source: hashicorp/terraform

We are seeing fairly regular issues deleting aws_db_option_group when removing the aws_db_instance first in the same destroy path.

Looking at the debug logs, the issue is that while the DB instance is non-existent per the Request rds/DescribeDBInstances returning 404 however upon initial rds/DeleteOptionGroup request there is a 400 error thrown for InvalidOptionGroupStateFault due to The option group 'dev-data-primary-justin-option-group' cannot be deleted because it is in use.

Terraform Version

0.6.16+

Affected Resource(s)

  • aws_db_option_group

    Debug Output

* aws_db_option_group.xmldb: Error Deleting DB Option Group: InvalidOptionGroupStateFault: The option group 'dev-data-primary-option-group' cannot be deleted because it is in use.
    status code: 400, request id: d732f0b9-37a5-11e6-a48d-af638ac63cab

Expected Behavior

DB Option group deletes properly seeing that AWS DB Instance had been deleted

Actual Behavior

AWS exception stating that DB Option Group is still in use and fails deletion (intermittently but primarily with Oracle RDS instances)

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform destroy

Important Factoids

I have been unable to replicate this yet with smaller MySQL instances however can consistently reproduce with the Oracle 11-ee instance we have based off a larger snapshot.

bug provideaws

Most helpful comment

I (still) get this issue consistently with SQL Server. Eventually after a few days you can delete the option set.

All 3 comments

I know that this was fixed by increasing the timeout limit. I am wondering if as a best practice it would be beneficial to allow an acceptable timeout switch. Not just for this but for all items.

I (still) get this issue consistently with SQL Server. Eventually after a few days you can delete the option set.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings