You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created two similar terraform configurations in the same AWS account/region. Upon applying the first, it created a database instance. The second finished very quickly, and when I looked in the console, I saw only one RDS instance. I noticed right away that the variable I was using to specify the name had left off a suffix, so they shared the same name and basically the same configuration including subnet groups and security groups.
This could have led to massive database corruption, as two deployments would have tried to use the same database.
I would have expected the second one to explode and tell me it couldn't create another database of the same name.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
I would expect duplicate databases in different state files to block each other, with one succeeding, and the other failing because the resource already exists.
Actual Behavior
Terraform happily assimilates the resource from the first, leading to dual-ownership.
Steps to Reproduce
create two nearly identical but completely separate top-level configs with an aws_db_instance. They should be the same except for their state file.
Apply config A
Apply config B
List RDS instances, you will see only one DB, and an identical state entry in both separate state files.
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered:
Hey @SpamapS 👋 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?
I created two similar terraform configurations in the same AWS account/region. Upon applying the first, it created a database instance. The second finished very quickly, and when I looked in the console, I saw only one RDS instance. I noticed right away that the variable I was using to specify the name had left off a suffix, so they shared the same name and basically the same configuration including subnet groups and security groups.
This could have led to massive database corruption, as two deployments would have tried to use the same database.
I would have expected the second one to explode and tell me it couldn't create another database of the same name.
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Available upon request.
Panic Output
N/A
Expected Behavior
I would expect duplicate databases in different state files to block each other, with one succeeding, and the other failing because the resource already exists.
Actual Behavior
Terraform happily assimilates the resource from the first, leading to dual-ownership.
Steps to Reproduce
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered: