-
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
Importing aws_security_group creates aws_security_group_rule's #6652
Comments
For anyone who stumbled across this issue, here is your quick and dirty to fix your state:
You can then execute
😮 |
Additionally, DB may not be locking (or respecting locks):
Since this feature doesn't appear to support |
I am reproducing this issue with When I want to do a terraform plan, it potentially wants to delete the resources, as there's a mismatch between the state and tf declaration.
WORKAROUND: After doing an import I have to run this: |
Please note that we plan on addressing this for the 3.0.0 release of the Terraform AWS Provider, likely in a few weeks. |
This has been released in version 3.0.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 for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
Affected Resource(s)
Expected Behavior
When importing
aws_security_group
resources, I would expect onlyaws_security_group
resource be added to the state file.Actual Behavior
Instead of creating rules inside a
aws_security_group
, the unexpect state ofaws_security_group_rule
s is added to state after an import, needing tostate rm
potentially hundreds for resources from state to clean up.Example:
The text was updated successfully, but these errors were encountered: