Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_security_group_rule: Support all non-zero
from_port
an…
…d `to_port` configurations with `protocol` ALL/-1 This completely suppresses `from_port` and `to_port` differences when `protocol` is `ALL` or `-1`. The API ignores them in this scenario, so previously it was possible to specify whatever non-zero values you wished (-1 for both, 0 and 65535, etc), but previously the logic was not showing the difference. Previously: ``` --- FAIL: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (16.96s) testing.go:538: Step 0 error: After applying this step and refreshing, the plan was not empty: DIFF: DESTROY/CREATE: aws_security_group_rule.test cidr_blocks.#: "1" => "1" cidr_blocks.0: "0.0.0.0/0" => "0.0.0.0/0" description: "description1" => "description1" from_port: "0" => "-1" (forces new resource) protocol: "-1" => "-1" security_group_id: "sg-04722579708a472f8" => "sg-04722579708a472f8" self: "false" => "false" source_security_group_id: "" => "<computed>" to_port: "0" => "-1" (forces new resource) type: "ingress" => "ingress" ``` Output from acceptance testing: ``` --- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidTypeError (1.70s) --- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidCIDR (1.84s) --- PASS: TestAccAWSSecurityGroupRule_MultiIngress (23.08s) --- PASS: TestAccAWSSecurityGroupRule_EgressDescription (23.84s) --- PASS: TestAccAWSSecurityGroupRule_Issue5310 (24.41s) --- PASS: TestAccAWSSecurityGroupRule_Ingress_Classic (24.04s) --- PASS: TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash (25.85s) --- PASS: TestAccAWSSecurityGroupRule_Ingress_VPC (27.91s) --- PASS: TestAccAWSSecurityGroupRule_IngressDescription (28.45s) --- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (30.69s) --- PASS: TestAccAWSSecurityGroupRule_Egress (36.77s) --- PASS: TestAccAWSSecurityGroupRule_IngressDescription_updates (37.11s) --- PASS: TestAccAWSSecurityGroupRule_SelfSource (42.98s) --- PASS: TestAccAWSSecurityGroupRule_EgressDescription_updates (43.95s) --- PASS: TestAccAWSSecurityGroupRule_SelfReference (44.43s) --- PASS: TestAccAWSSecurityGroupRule_Ingress_Ipv6 (45.83s) --- PASS: TestAccAWSSecurityGroupRule_PartialMatching_Source (50.10s) --- PASS: TestAccAWSSecurityGroupRule_PartialMatching_basic (51.93s) --- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts (52.00s) --- PASS: TestAccAWSSecurityGroupRule_PrefixListEgress (57.10s) --- PASS: TestAccAWSSecurityGroupRule_Ingress_Protocol (37.05s) --- PASS: TestAccAWSSecurityGroupRule_MultiDescription (89.38s) --- PASS: TestAccAWSSecurityGroupRule_Race (275.19s) ```
- Loading branch information