-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
import aws_security_group creates impossible resources #13827
Comments
This is happening on both My workaround was manually editing the state file 😞 |
My pull request #14332 will fix this once I change the way security groups are imported to use the new |
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. |
Howdy.
In the case where an AWS security group rule exists that includes both the security group itself and a CIDR range, the aws security group import creates a resource that has both a non-empty cidr_blocks as well as the "self" flag set to true.
However, attempting to apply corresponding terraform resource config produces an error message.
Here's the relevant section of the security group from the AWS API:
Note that the (redacted)
sg-01234567
is the ID of this security group.Here's the "state" for this rule generated when
terraform import …
is run:Note how it has both
self = true
andcidr_blocks.# = 1
.Here's terraform config that matches this rule:
Here's the error from
terraform plan
attempting to plan/apply this rule:The text was updated successfully, but these errors were encountered: