-
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
providers/aws: aws_security_group v0.6.10 regression #4872
Comments
Hi @pmoust, thanks for the report. This looks like it might be the SG rule drift detection fix from #4779 in action. We discovered a long-standing bug in nested security group rules that prevented rule drift from being written back to the state during an I'll add to the release notes to call out this possibility for other users. If you compare the diffs you're seeing to the state of the rules on the SGs is AWS, does this seem like the proper explanation? |
Will get back to you on this @phinze , that must be it. |
I'm also experiencing this issue. Is there any info I can provide to help? |
I'm also seeing this problem on a handful of security groups. FWIW it only happens with security groups that have more then one ingress rule. With the exception of one security group that has two ingress rules where they are both CIDRs. Here's an example:
And the output of the plan:
Doing a |
Having the same problem here. Example terraform definition: https://gist.github.com/iserko/d69fd1a9a8092825d5bc As soon as I merge |
Hello – I just opened #4983 for consideration. I think the documentation is out of date and is remedied there, but also it should fix a bug with EC2 Classic environments |
i can confirm that as iserko said this problem happens when you have multiple ingress/egress blocks that specify the same port/protocol. i modified the port range to: 6379-6380 on one of the blocks and it worked. not ideal but better then before. |
I've also just hit this problem, in my case the security groups' rules differed in that one used a cidr block and the other used "self=true" (i.e. same protocol/ports otherwise). Using both self=true and a cidr block constraint within the same "ingress" or "egress" block, which did not previously work, now also does, as a workaround/fix. |
Hey @r0p0s3c –
did this not work in v0.6.9? Or farther back from then? If anyone else is still having issue that are not resolved by #4983 , or are not sure how to verify that, please let me know! |
Hi @catsby, correct, this didn't work with the last release I used, which was 0.6.9. I don't believe that self=true was documented as being incompatible with security_groups, unlike cidr_block, but that's why I found. |
the |
Correct, the issue I was having was with aws_security_group, so inline rules. Ingress/egress rules such as this:
previously did not work for me. |
Hello friends – We've identified more information regarding the regression revealed/caused by #4779 and I'm currently working on a fix. Unfortunately that fix involves replacing much of how this resource handles it's in-line rules, so it's taking a bit of time. I do anticipate having a patch to address it early this week though. In the meantime, the work-around is to converge your in-line rules by Let me know if you have other questions, otherwise I'll try to keep this issue updated Also related: |
Guys, Another big thing that I have had in particular problems with that causes drift is using a unaligned CIDR. I don't have output, but it should be easy to reproduce. Some behaviour I saw from it:
Some CIDR checks are probably in order to correct some of this at least. |
Thanks for the heads up @catsby |
This seemed to have been fixed in 0.6.12 for me ... can anyone else confirm? |
@pmoust can you verify if terraform 0.6.12 fixes your issue? |
It does not solve in 0.6.12. Currently, security group ID of self is always written to
This seems to cause a change occurs. If
I issued a pull request #5184, including the resolution of this problem. This is the location of the problem. |
@stack72 it doesn't |
I'm sorry, in 0.6.12 this problem seemed to have already been fixed. My pull request that I put out is also likely to be room for reconsideration. |
FWIW 0.6.12 fixed my issue |
My original repro still stands |
My bad, it is indeed fixed! |
Nice one @pmoust |
Thank you all for confirming a fix here. If you're still having trouble, please open a new issue for me to track separately . Thanks |
I'm seeing this with 0.6.16. `resource "aws_security_group" "redacted" {
} ~ aws_security_group.redacted I changed the IP's to protect the innocent. If the IPs don't match, it's a typo that occurred when I manually obfuscated the IPs. |
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. |
Running
terraform plan -out /tmp/plan -target=aws_security_group.pph_webserver
with terraform v0.6.10No change in the terraform resource. This happens to other SGs as well (not all of them though), added one resource to refrain from TL;DR.
Expected result: no change plan
Actual results pasted below
In 0.6.9 it's ok.
State diff
The text was updated successfully, but these errors were encountered: