Open alex-herold opened 4 years ago
Looks like an error should be returned here for this:
It would be great if TF can indeed throw an error there rather than continuing with issuing the AWS API call with the port values discarded
I just landed on this bug and this is a glaring security issue that is not obvious and can cause security issues and may have already caused security issues.
And when you try to change this, terraform thinks the rule doesn't exist in it's state when you try to destroy it.
+1
Hey y'all š Thank you for taking the time to file this issue, and for the discussion around it. Given that there's been a number of AWS provider releases since the last update, can anyone confirm if you're still experiencing this behavior?
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Expecting Terraform to throw an error or at least a warning stating that a non-zero port number was used, but a port-specific protocol (udp or tcp) was not specified. This allows for the possibility to open up all ports/protocols as opposed to very specific ranges due to a simple typo.
Given the level of impact, a warning or error would enhance the guardrails around TF.
Actual Behavior
A security group rule allowing all ports, all protocols was created.
References
https://www.terraform.io/docs/providers/aws/r/security_group_rule.html