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/aws_wafregional_xss_match_set: Fix 'panic: interface conversion: interface {} is *schema.Set, not []interface {}' #13024

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 26, 2020

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

Closes #13014.

Also add read after create and plan-time validations, similar to #12777.

Release note for CHANGELOG:

resource/aws_wafregional_xss_match_set: Fix crash during resource update

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSWafRegionalXssMatchSet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSWafRegionalXssMatchSet_ -timeout 120m
=== RUN   TestAccAWSWafRegionalXssMatchSet_basic
=== PAUSE TestAccAWSWafRegionalXssMatchSet_basic
=== RUN   TestAccAWSWafRegionalXssMatchSet_changeNameForceNew
=== PAUSE TestAccAWSWafRegionalXssMatchSet_changeNameForceNew
=== RUN   TestAccAWSWafRegionalXssMatchSet_disappears
=== PAUSE TestAccAWSWafRegionalXssMatchSet_disappears
=== RUN   TestAccAWSWafRegionalXssMatchSet_changeTuples
=== PAUSE TestAccAWSWafRegionalXssMatchSet_changeTuples
=== RUN   TestAccAWSWafRegionalXssMatchSet_noTuples
=== PAUSE TestAccAWSWafRegionalXssMatchSet_noTuples
=== CONT  TestAccAWSWafRegionalXssMatchSet_basic
=== CONT  TestAccAWSWafRegionalXssMatchSet_changeTuples
=== CONT  TestAccAWSWafRegionalXssMatchSet_disappears
=== CONT  TestAccAWSWafRegionalXssMatchSet_changeNameForceNew
=== CONT  TestAccAWSWafRegionalXssMatchSet_noTuples
--- PASS: TestAccAWSWafRegionalXssMatchSet_noTuples (26.75s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_disappears (30.52s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_basic (35.65s)
--- FAIL: TestAccAWSWafRegionalXssMatchSet_changeTuples (54.18s)
    testing.go:669: Step 2 error: After applying this step and refreshing, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_wafregional_xss_match_set.test
          id:                                      "da4c4cf8-24d3-4749-aef3-13a9b487abe5" => "da4c4cf8-24d3-4749-aef3-13a9b487abe5"
          name:                                    "tf-acc-test-8703340596436274492" => "tf-acc-test-8703340596436274492"
          xss_match_tuple.#:                       "2" => "2"
          xss_match_tuple.0.field_to_match.#:      "1" => "1"
          xss_match_tuple.0.field_to_match.0.data: "" => "GET"
          xss_match_tuple.0.field_to_match.0.type: "BODY" => "METHOD"
          xss_match_tuple.0.text_transformation:   "CMD_LINE" => "HTML_ENTITY_DECODE"
          xss_match_tuple.1.field_to_match.#:      "1" => "1"
          xss_match_tuple.1.field_to_match.0.data: "" => ""
          xss_match_tuple.1.field_to_match.0.type: "METHOD" => "BODY"
          xss_match_tuple.1.text_transformation:   "HTML_ENTITY_DECODE" => "CMD_LINE"
        
        
        
        STATE:
        
        aws_wafregional_xss_match_set.test:
          ID = da4c4cf8-24d3-4749-aef3-13a9b487abe5
          provider = provider.aws
          name = tf-acc-test-8703340596436274492
          xss_match_tuple.# = 2
          xss_match_tuple.0.field_to_match.# = 1
          xss_match_tuple.0.field_to_match.0.data = 
          xss_match_tuple.0.field_to_match.0.type = BODY
          xss_match_tuple.0.text_transformation = CMD_LINE
          xss_match_tuple.1.field_to_match.# = 1
          xss_match_tuple.1.field_to_match.0.data = 
          xss_match_tuple.1.field_to_match.0.type = METHOD
          xss_match_tuple.1.text_transformation = HTML_ENTITY_DECODE
--- PASS: TestAccAWSWafRegionalXssMatchSet_changeNameForceNew (56.69s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	56.745s
FAIL
GNUmakefile:26: recipe for target 'testacc' failed
make: *** [testacc] Error 1

…terface {} is *schema.Set, not []interface {}'.
@ewbankkit ewbankkit requested a review from a team April 26, 2020 20:26
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/M 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 26, 2020
@ewbankkit
Copy link
Contributor Author

The diff during plan after update has been noted in #8865.
I will address that separately.

@bflad bflad added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 28, 2020
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.

LGTM, thank you for fixing this, @ewbankkit 🚀

Output from acceptance testing (failure unrelated):

--- PASS: TestAccAWSWafRegionalXssMatchSet_basic (20.28s)
--- FAIL: TestAccAWSWafRegionalXssMatchSet_changeTuples (20.72s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_disappears (22.95s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_changeNameForceNew (26.83s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_noTuples (36.76s)

@bflad bflad added this to the v2.60.0 milestone Apr 28, 2020
@bflad bflad merged commit 4661041 into hashicorp:master Apr 28, 2020
bflad added a commit that referenced this pull request Apr 28, 2020
bflad added a commit that referenced this pull request Apr 28, 2020
@sc250024
Copy link

Thanks @ewbankkit

@ewbankkit
Copy link
Contributor Author

Also closes #12106.

@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.60.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!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this pull request May 28, 2020
…ion: interface {} is *schema.Set, not []interface {}'. (hashicorp#13024)

Output from acceptance testing:

```
--- PASS: TestAccAWSWafRegionalXssMatchSet_basic (20.28s)
--- FAIL: TestAccAWSWafRegionalXssMatchSet_changeTuples (20.72s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_disappears (22.95s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_changeNameForceNew (26.83s)
--- PASS: TestAccAWSWafRegionalXssMatchSet_noTuples (36.76s)
```
@ghost
Copy link

ghost commented May 28, 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 28, 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. crash Results from or addresses a Terraform crash or kernel panic. service/waf Issues and PRs that pertain to the waf service. size/M 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.

[CRASH] Applying WAFv1 module results in Terraform v0.12.24 crash
3 participants