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_apigatewayv2_integration: Suppress integration_method diff for AWS Lambda integrations #13266

Merged
merged 4 commits into from
Jul 28, 2020

Conversation

ewbankkit
Copy link
Contributor

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 #13261.

Release note for CHANGELOG:

resource/aws_apigatewayv2_integration: Correctly handle the `integration_method` attribute for AWS Lambda integrations

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Integration_basic
=== PAUSE TestAccAWSAPIGatewayV2Integration_basic
=== RUN   TestAccAWSAPIGatewayV2Integration_disappears
=== PAUSE TestAccAWSAPIGatewayV2Integration_disappears
=== RUN   TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_Lambda
=== PAUSE TestAccAWSAPIGatewayV2Integration_Lambda
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLink
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLink
=== CONT  TestAccAWSAPIGatewayV2Integration_basic
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLink
=== CONT  TestAccAWSAPIGatewayV2Integration_Lambda
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (24.40s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basic (28.62s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (44.79s)
--- PASS: TestAccAWSAPIGatewayV2Integration_Lambda (60.46s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLink (721.77s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	721.831s

Without the fix:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_Lambda'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_Lambda -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Integration_Lambda
=== PAUSE TestAccAWSAPIGatewayV2Integration_Lambda
=== CONT  TestAccAWSAPIGatewayV2Integration_Lambda
--- FAIL: TestAccAWSAPIGatewayV2Integration_Lambda (40.09s)
    testing.go:683: Step 0 error: After applying this step, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_apigatewayv2_integration.test
          api_id:                                    "60w0poref8" => "60w0poref8"
          connection_id:                             "" => ""
          connection_type:                           "INTERNET" => "INTERNET"
          content_handling_strategy:                 "CONVERT_TO_TEXT" => "CONVERT_TO_TEXT"
          credentials_arn:                           "arn:aws:iam::123456789012:user/kit" => "arn:aws:iam::123456789012:user/kit"
          description:                               "Test Lambda" => "Test Lambda"
          id:                                        "9fisag7" => "9fisag7"
          integration_method:                        "POST" => ""
          integration_response_selection_expression: "${integration.response.body.errorMessage}" => "${integration.response.body.errorMessage}"
          integration_type:                          "AWS" => "AWS"
          integration_uri:                           "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:tf-acc-test-8699519484167888654/invocations" => "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:tf-acc-test-8699519484167888654/invocations"
          passthrough_behavior:                      "WHEN_NO_MATCH" => "WHEN_NO_MATCH"
          payload_format_version:                    "1.0" => "1.0"
          template_selection_expression:             "" => ""
          timeout_milliseconds:                      "29000" => "29000"

@ewbankkit ewbankkit requested a review from a team May 11, 2020 20:13
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. labels May 11, 2020
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 23, 2020
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Jul 23, 2020
@ewbankkit
Copy link
Contributor Author

Added additional acceptance tests for Lambda integration with HTTP API.
Re-ran all acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_disappears
=== PAUSE TestAccAWSAPIGatewayV2Integration_disappears
=== RUN   TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (13.33s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (15.88s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (16.22s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (23.36s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (38.84s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (44.98s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (281.84s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (705.82s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	705.921s

@ewbankkit ewbankkit requested review from DrFaust92 and removed request for a team July 23, 2020 22:31
Copy link
Collaborator

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

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

LGTM

--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (44.76s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (40.32s)
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (38.94s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (66.32s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (83.50s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (88.47s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (770.23s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (376.69s)

@breathingdust
Copy link
Member

LGTM 🚀 Thanks @ewbankkit!

Verified Acceptance Tests (Commercial)

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_disappears
=== PAUSE TestAccAWSAPIGatewayV2Integration_disappears
=== RUN   TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (12.45s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (13.94s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (14.49s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (21.82s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (34.14s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (38.18s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (270.85s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (697.70s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	700.776s

Verified Acceptance Tests (GovCloud)

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_disappears
=== PAUSE TestAccAWSAPIGatewayV2Integration_disappears
=== RUN   TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (8.02s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (9.87s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (10.10s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (13.96s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (28.73s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (33.24s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (237.63s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (711.46s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	713.850s

@breathingdust breathingdust added this to the v3.0.0 milestone Jul 28, 2020
@breathingdust breathingdust merged commit 8f3da25 into hashicorp:master Jul 28, 2020
breathingdust added a commit that referenced this pull request Jul 28, 2020
@ewbankkit ewbankkit deleted the issue-13261 branch July 28, 2020 16:43
@ghost
Copy link

ghost commented Jul 31, 2020

This has been released in version 3.0.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 Aug 27, 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 Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 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.

Api Gateway V2 (Web Sockets) Integration error on re-apply
3 participants