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: Data mapping in HTTP APIs #17043

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jan 10, 2021

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

Release note for CHANGELOG:

resource/aws_apigatewayv2_integration: Add `response_parameters` attribute.

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_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Integration_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Integration_disappears
=== PAUSE TestAccAWSAPIGatewayV2Integration_disappears
=== RUN   TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== 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
=== RUN   TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== PAUSE TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (29.08s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (30.68s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (32.61s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (46.05s)
--- PASS: TestAccAWSAPIGatewayV2Integration_DataMappingHttp (48.71s)
--- PASS: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (48.96s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (49.47s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (53.71s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (412.36s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (718.91s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	719.017s

@ewbankkit ewbankkit requested a review from a team as a code owner January 10, 2021 23:37
@ghost ghost added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 10, 2021
Comment on lines +348 to +351
o, n := d.GetChange("response_parameters")
os := o.(*schema.Set)
ns := n.(*schema.Set)
del := os.Difference(ns).List()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think has go common enough at this point, should we maybe encapsulate it into a function and reuse? or is it too simple?

Copy link
Contributor Author

@ewbankkit ewbankkit Jan 11, 2021

Choose a reason for hiding this comment

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

Something like we do for diffStringMaps?
For example:

func diffSets(oldSet, newSet *schema.Set) (create, remove, unchanged *schema.Set) {
...
}

Copy link
Collaborator

@DrFaust92 DrFaust92 Jan 13, 2021

Choose a reason for hiding this comment

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

Yes.

Acceptance test output:

$ 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_DataMappingHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== 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
=== RUN   TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== PAUSE TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (29.08s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (30.68s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (32.61s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (46.05s)
--- PASS: TestAccAWSAPIGatewayV2Integration_DataMappingHttp (48.71s)
--- PASS: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (48.96s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (49.47s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (53.71s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (412.36s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (718.91s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	719.017s
@ewbankkit ewbankkit force-pushed the f-aws_apigatewayv2_integration-http-api-data-mappings branch from c3df40d to 8aa6d44 Compare January 11, 2021 22:24
@ghost ghost added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Jan 11, 2021
@ewbankkit ewbankkit changed the title [WIP] r/aws_apigatewayv2_integration: Data mapping in HTTP APIs r/aws_apigatewayv2_integration: Data mapping in HTTP APIs Jan 11, 2021
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.

--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (57.18s)
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (57.23s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (88.15s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (92.34s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (93.68s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (104.58s)
--- PASS: TestAccAWSAPIGatewayV2Integration_DataMappingHttp (113.15s)
--- PASS: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (115.05s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (417.91s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (786.26s)

@DrFaust92 DrFaust92 removed their assignment Jan 13, 2021
@breathingdust
Copy link
Member

LGTM 🚀 Thanks @ewbankkit!

Verified Acceptance Tests in Commercial (us-west-2)

 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_DataMappingHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== 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
=== RUN   TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== PAUSE TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
=== CONT  TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (15.12s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (17.32s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (17.89s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (27.02s)
--- PASS: TestAccAWSAPIGatewayV2Integration_DataMappingHttp (27.59s)
--- PASS: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (29.56s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (34.02s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (40.61s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (293.96s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (677.39s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	679.215s

Verified Acceptance Tests in GovCloud (us-gov-west-1)

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_DataMappingHttp
=== PAUSE TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== 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
=== RUN   TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== PAUSE TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_DataMappingHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_LambdaWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket
=== CONT  TestAccAWSAPIGatewayV2Integration_disappears
=== CONT  TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp
=== CONT  TestAccAWSAPIGatewayV2Integration_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Integration_disappears (10.72s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicHttp (11.48s)
--- PASS: TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp (17.52s)
--- PASS: TestAccAWSAPIGatewayV2Integration_DataMappingHttp (19.67s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaWebSocket (32.03s)
--- PASS: TestAccAWSAPIGatewayV2Integration_basicWebSocket (42.01s)
--- PASS: TestAccAWSAPIGatewayV2Integration_LambdaHttp (44.47s)
--- PASS: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (54.64s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkHttp (319.70s)
--- PASS: TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket (699.79s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	701.398s

@breathingdust breathingdust merged commit dd23ae3 into hashicorp:master Jan 14, 2021
@github-actions github-actions bot added this to the v3.24.0 milestone Jan 14, 2021
breathingdust added a commit that referenced this pull request Jan 14, 2021
@ewbankkit ewbankkit deleted the f-aws_apigatewayv2_integration-http-api-data-mappings branch January 14, 2021 14:18
@ghost
Copy link

ghost commented Jan 15, 2021

This has been released in version 3.24.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 Feb 13, 2021

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 as resolved and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 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.

Amazon API Gateway data mapping in HTTP APIs
3 participants