Skip to content
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

resource/aws_network_acl: Make action in ingress / egress case insensitive #1000

Merged
merged 1 commit into from
Jun 29, 2017

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jun 29, 2017

Fixes: #918

Add a diff suppress func to stop case sensitivity issues on the Action
param of ingress and egress. To do this, I had to make sure that the
hash always used the lowercase version (this will mean that users who do
not see a perpetual diff are not affected)

% make testacc TEST=./aws TESTARGS='-run=TestAccAWSNetworkAcl_'                                                               ✹ ✭
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSNetworkAcl_ -timeout 120m
=== RUN   TestAccAWSNetworkAcl_importBasic
--- PASS: TestAccAWSNetworkAcl_importBasic (51.69s)
=== RUN   TestAccAWSNetworkAcl_EgressAndIngressRules
--- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (49.22s)
=== RUN   TestAccAWSNetworkAcl_OnlyIngressRules_basic
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (61.61s)
=== RUN   TestAccAWSNetworkAcl_OnlyIngressRules_update
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (91.95s)
=== RUN   TestAccAWSNetworkAcl_CaseSensitivityNoChanges
--- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (57.69s)
=== RUN   TestAccAWSNetworkAcl_OnlyEgressRules
--- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (60.46s)
=== RUN   TestAccAWSNetworkAcl_SubnetChange
--- PASS: TestAccAWSNetworkAcl_SubnetChange (92.92s)
=== RUN   TestAccAWSNetworkAcl_Subnets
--- PASS: TestAccAWSNetworkAcl_Subnets (108.76s)
=== RUN   TestAccAWSNetworkAcl_ipv6Rules
--- PASS: TestAccAWSNetworkAcl_ipv6Rules (99.07s)
=== RUN   TestAccAWSNetworkAcl_ipv6VpcRules
--- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (37.64s)
=== RUN   TestAccAWSNetworkAcl_espProtocol
--- PASS: TestAccAWSNetworkAcl_espProtocol (57.23s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	768.271s

…itive

Fixes: #918

Add a diff suppress func to stop case sensitivity issues on the Action
param of ingress and egress. To do this, I had to make sure that the
hash always used the lowercase version (this will mean that users who do
not see a perpetual diff are not affected)
@stack72 stack72 added the bug Addresses a defect in current functionality. label Jun 29, 2017
Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor comment/improvement

@@ -118,6 +125,12 @@ func resourceAwsNetworkAcl() *schema.Resource {
"action": {
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff suppress is fairly common. Worth splitting it out into a core level function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's common - one thing i saw in the committers channel the other day is that sometimes it's preferred to copy small pieces of code like this rather than need to vendor them - thoughts?

@stack72 stack72 merged commit 9da0313 into master Jun 29, 2017
@stack72 stack72 deleted the b-aws-network-acl-caseinsensitive-918 branch June 29, 2017 15:50
@ghost
Copy link

ghost commented Apr 11, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform always rebuild aws_network_acl when rules are capitalized
2 participants