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

r/waf_xss_match_set: read after create + validations #12777

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

DrFaust92
Copy link
Collaborator

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

resource_awaf_xss_match_set: add plan time validations to `xss_match_tuples.text_transformation` and `xss_match_tuples.field_to_match.type`

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSWafXssMatchSet_'
--- PASS: TestAccAWSWafXssMatchSet_basic (46.65s)
--- PASS: TestAccAWSWafXssMatchSet_changeNameForceNew (92.59s)
--- PASS: TestAccAWSWafXssMatchSet_disappears (51.95s)
--- PASS: TestAccAWSWafXssMatchSet_noTuples (51.06s)

--- FAIL: TestAccAWSWafXssMatchSet_changeTuples (79.49s) -- unrelated to change

@DrFaust92 DrFaust92 requested a review from a team April 11, 2020 14:49
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. service/waf Issues and PRs that pertain to the waf service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 11, 2020
@ewbankkit
Copy link
Contributor

Verified acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSWafXssMatchSet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSWafXssMatchSet_ -timeout 120m
=== RUN   TestAccAWSWafXssMatchSet_basic
=== PAUSE TestAccAWSWafXssMatchSet_basic
=== RUN   TestAccAWSWafXssMatchSet_changeNameForceNew
=== PAUSE TestAccAWSWafXssMatchSet_changeNameForceNew
=== RUN   TestAccAWSWafXssMatchSet_disappears
=== PAUSE TestAccAWSWafXssMatchSet_disappears
=== RUN   TestAccAWSWafXssMatchSet_changeTuples
=== PAUSE TestAccAWSWafXssMatchSet_changeTuples
=== RUN   TestAccAWSWafXssMatchSet_noTuples
=== PAUSE TestAccAWSWafXssMatchSet_noTuples
=== CONT  TestAccAWSWafXssMatchSet_basic
=== CONT  TestAccAWSWafXssMatchSet_changeTuples
=== CONT  TestAccAWSWafXssMatchSet_noTuples
=== CONT  TestAccAWSWafXssMatchSet_disappears
=== CONT  TestAccAWSWafXssMatchSet_changeNameForceNew
--- PASS: TestAccAWSWafXssMatchSet_disappears (23.47s)
--- PASS: TestAccAWSWafXssMatchSet_noTuples (25.67s)
--- PASS: TestAccAWSWafXssMatchSet_basic (29.74s)
--- FAIL: TestAccAWSWafXssMatchSet_changeTuples (39.41s)
    testing.go:669: Step 1 error: After applying this step and refreshing, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_waf_xss_match_set.test
          arn:                                      "arn:aws:waf::123456789012:xssmatchset/b0a724ed-8aca-4b12-98d4-bf59fbf57da9" => "arn:aws:waf::123456789012:xssmatchset/b0a724ed-8aca-4b12-98d4-bf59fbf57da9"
          id:                                       "b0a724ed-8aca-4b12-98d4-bf59fbf57da9" => "b0a724ed-8aca-4b12-98d4-bf59fbf57da9"
          name:                                     "tf-acc-test-9078190377999963862" => "tf-acc-test-9078190377999963862"
          xss_match_tuples.#:                       "2" => "2"
          xss_match_tuples.0.field_to_match.#:      "1" => "1"
          xss_match_tuples.0.field_to_match.0.data: "" => "GET"
          xss_match_tuples.0.field_to_match.0.type: "BODY" => "METHOD"
          xss_match_tuples.0.text_transformation:   "CMD_LINE" => "HTML_ENTITY_DECODE"
          xss_match_tuples.1.field_to_match.#:      "1" => "1"
          xss_match_tuples.1.field_to_match.0.data: "" => ""
          xss_match_tuples.1.field_to_match.0.type: "METHOD" => "BODY"
          xss_match_tuples.1.text_transformation:   "HTML_ENTITY_DECODE" => "CMD_LINE"
        
        
        
        STATE:
        
        aws_waf_xss_match_set.test:
          ID = b0a724ed-8aca-4b12-98d4-bf59fbf57da9
          provider = provider.aws
          arn = arn:aws:waf::123456789012:xssmatchset/b0a724ed-8aca-4b12-98d4-bf59fbf57da9
          name = tf-acc-test-9078190377999963862
          xss_match_tuples.# = 2
          xss_match_tuples.0.field_to_match.# = 1
          xss_match_tuples.0.field_to_match.0.data = 
          xss_match_tuples.0.field_to_match.0.type = BODY
          xss_match_tuples.0.text_transformation = CMD_LINE
          xss_match_tuples.1.field_to_match.# = 1
          xss_match_tuples.1.field_to_match.0.data = 
          xss_match_tuples.1.field_to_match.0.type = METHOD
          xss_match_tuples.1.text_transformation = HTML_ENTITY_DECODE
--- PASS: TestAccAWSWafXssMatchSet_changeNameForceNew (45.96s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	46.014s
FAIL
GNUmakefile:26: recipe for target 'testacc' failed
make: *** [testacc] Error 1

That error has been raised in #8865.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 23, 2020
@DrFaust92
Copy link
Collaborator Author

DrFaust92 commented Apr 23, 2020

@ewbankkit , I tried looking at #8865 as part of this PR but i was not able to fix this with diff suppression like other PRs. it just seems to ignore it. i'm assuming this is related that this is TypeSet for a complex structure but it's just a hunch.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @DrFaust92 🚀

Output from acceptance testing (failure unrelated):

--- PASS: TestAccAWSWafXssMatchSet_noTuples (12.95s)
--- PASS: TestAccAWSWafXssMatchSet_disappears (22.00s)
--- PASS: TestAccAWSWafXssMatchSet_changeNameForceNew (33.96s)
--- FAIL: TestAccAWSWafXssMatchSet_changeTuples (42.59s)
--- PASS: TestAccAWSWafXssMatchSet_basic (45.94s)

@bflad bflad added this to the v2.59.0 milestone Apr 23, 2020
@bflad bflad merged commit bfc0450 into hashicorp:master Apr 23, 2020
bflad added a commit that referenced this pull request Apr 23, 2020
@ghost
Copy link

ghost commented Apr 24, 2020

This has been released in version 2.59.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 24, 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 May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/waf Issues and PRs that pertain to the waf service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants