-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: r/aws_db_instance_automated_backups_replication: unexpected state 'Pending'
#32597
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Just want to note that it looks like the resource does get created and originally it will be in the Pending state and then switch over to the Replicating state. However, the error message is concerning to the person running the terraform. |
It seems like there is an issue probably because the terraform did not complete because the next time I do a apply, it says the resource is tainted and must be replaced. When it goes destroys the resource and recreate it, I get an error stating
but the replication has already been deleted. |
I'm having the exact same issue, with a slightly different setup. My DB already exists in us-east-1, and I'm adding backup replication to us-west-1. Terraform v1.5.3
When I apply, it shows only the replication to be created.
But then I get the same error output, with a tainted status, and also the replication is eventually successful. I can untaint the replication resource, and everything seems fine. A similar workflow occurs on import->update.
Update to add one more behavior. After an untaint, if I remove the aws_db_instance_automated_backups_replication from configuration and apply, sometimes, but not every time, I'll have this error:
|
It appears that the cloudtrail response is definitely The example referenced in the CLI docs reference 'pending' even though the API defines the responses as https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/start-db-instance-automated-backups-replication.html |
I am also experiencing a similar issue with the following error: |
Thank you two for sharing your experience! It looks like there needs to be a change over here? To not assert for the 'replicating' status? |
I'm facing the same issue with 5.6.2. |
I was able to resolve temporarily by removing the state and importing it back. Since the resource is already replicating, plan shows no changes afterwards |
So you did a terraform state rm [module].[resourcename] and then just apply it again? |
I was having a similar result if I used untaint. You can have mixed results after that, if you try to apply another change too quickly, if the DB isn't actually finished modifying. |
terraform state rm [module].[resourcename], then terraform import [module].[resourcename] [resource id] |
I am facing the same issue with cross-region automated backups. It failed but also enables the cross-region feature on the target automated backup and starts to creating replica snapshots in another region. |
This worked! Thank you! And also just for clarity sake, it seems like the [resource id] is simply the ARN of the backup. |
I also think it would be better for this resource to contain information about the snapshots it created, not simply the id of the automated backups :( |
Although there is a workaround, we would still want a fix for this, please. |
I'm also facing the same error ,and looking forward to get a fix on this issue as soon as possible |
unexpected state 'Pending'
It looks like the AWS RDS API status codes change capitalization without any notification 😢. |
That was my guess, since there were no issues and then suddenly several in one day. Very nice of them to do that, if so. I just don't know enough of GO to try to provide a change myself.
But I do believe this is the correct location in code |
I am working on a fix... |
@ewbankkit - will this fix be propagated to 4.x versions? |
The following also works as a workaround : terraform untaint aws_db_instance_automated_backups_replication.your_resource_name |
how can I get this update? |
This functionality has been released in v5.11.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Terraform Core Version
1.5.3
AWS Provider Version
5.8.0
Affected Resource(s)
aws_db_instance_automated_backups_replication
Expected Behavior
Creating the db_instance_automated_backups_replication resource should complete without any error
Actual Behavior
After creating a primary instance from this module; when creating db_instance_automated_backups_replication resource, it errors out.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: