-
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
provider/aws: aws_security_group_rule fails with protocol 50 or 51 #6888
Comments
I had lost track of this, but had a similar issue. I think there may be an issue with the AWS endpoint if memory serves me correctly where it was throwing an error even if I used it directly. |
@jrnt30 You are right about AWS endpoint. Here is what it looks like when I try to add "ah" or "esp" via aws cli:
Notice: "or any valid protocol number", when I try the above using 51 (the ah protocol number vs "ah") it does work. I'm positive now, the problem started from the PR which is converting 50 and 51 to "esp" and "ah" - #5881. At least for authorize-security-group-ingress (http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html) aws endpoint is expecting "esp" or "ah" to be the actual protocol numbers. |
That is the AWS CLI and I have seen similar things. I can try after work, but I am pretty sure if you try and do the same thing via the AWS GO SDK it was failing for me...but I am not 100% on that. I believe I had tried removing that mapping (to ESP) for this explicit reason but got distracted from the issue. |
@jrnt30 thanks! I should take the opportunity to get aws-go-sdk installed and test this out - I assume the aws endpoint behavior is going to be the same... (I hope!) - I'll update with results if I can get to it before you :) |
Modifying the example from aws go sdk docs:
The above compiles and when run results in the following error:
Worth noting that even the go sdk docs say: |
In our case we use a aws_security_group resource where we describe several ingress rules rather than a aws_security_group_rule and we see a different manifestation of the issue.
In any case it's not a show stopper but it's noisy... :( |
This will be fixed in 0.7.5 |
Note for posterity in case anyone lands here, because tf keeps reapplying your security group if it has an protocol ESP(50) rule. Typically "all ports" is -1 to -1. AWS has it as 0 to 0. (I suspect this is because ESP isn't "port-aware". If you just change your code to from port 0 to port 0, it will resolve your issues. |
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. |
Terraform Version
0.6.16
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/sarkis/2909062add54496b4dba0a69eaecd375
Panic Output
N/A
Expected Behavior
Security group rule created / updated in state
Actual Behavior
400 error from AWS
Steps to Reproduce
terraform apply
Important Factoids
Nothing unique to our infra, we are running in EC2 VPC and have not had this issue until 0.6.16.
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
Couldn't find any issues that directly relate to this one... Although, since we didn't have these problems with 0.6.14, it may be directly related to this PR:
#5881
The text was updated successfully, but these errors were encountered: