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.74k stars 9.1k forks source link

Missing database name for AWS Aurora Serverless can cause DB removal #12730

Open ghost opened 4 years ago

ghost commented 4 years ago

This issue was originally opened by @jordanboston as hashicorp/terraform#24601. It was migrated here as a result of the provider split. The original body of the issue is below.


Current Terraform Version

Terraform v0.12.23

Use-cases

When importing an aws_rds_cluster for Aurora Serverless where it has an existing database name (not shown anywhere in the console), it seems that the database name is never picked up even though it exists and is null in terraform state.

This causes the imported database to be destroyed on terraform apply since it wants to update the database name that seems non existent. Not sure if this is a bug or a needed update.

Attempted Solutions

Screen Shot 2020-04-08 at 10 12 17 AM

I workaround this by updating the actual terraform state file in S3 and adding the database_name in place of the null value. Then when I run terraform apply again, it works fine and does not try to destroy and recreate the database.

Proposal

Implement a way to include the database name on import so that the state file editing hack is not needed anymore.

Thanks

justinretzolk commented 2 years ago

Hey @jordanboston 👋 Thank you for taking the time to file this issue. Given that there's been a number of Terraform and AWS Provider releases since you initially filed it, can you confirm if you're still experiencing this behavior?

jordanboston commented 2 years ago

I have not had to setup a database in a long time to where I would encounter this. I would go test this out, but I have so much going on right now. If no one else has reported anything, maybe this is no longer a concern.

When I go to do updates later this year I can check if this is still a remaining problem or not. Thanks!

github-actions[bot] commented 1 month 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!