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

Amazon API Gateway data mapping in HTTP APIs #17021

Closed
ewbankkit opened this issue Jan 8, 2021 · 1 comment · Fixed by #17043
Closed

Amazon API Gateway data mapping in HTTP APIs #17021

ewbankkit opened this issue Jan 8, 2021 · 1 comment · Fixed by #17043
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 8, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Amazon API Gateway now supports data mapping definitions from an HTTP API’s method request data (e.g. path parameters, query string and headers) to the corresponding integration request parameters and from the integration response data (e.g. headers) to the HTTP API method response parameters.

New or Affected Resource(s)

Potential Terraform Configuration

The API's ResponseParameters field is a nested map of type map[string]map[string]*string and Terraform does not support nested maps, so we define response_parameter as a repeating block (TypeSet).

resource "aws_apigatewayv2_integration" "example" {
  request_parameters = {
    "append:header.header2" = "$request.header.header1"
    "remove:header.header1" = "''"
  }

  response_parameters {
    status_code = "500"

    mappings = {
      "append:header.header1" = "$context.requestId"
      "overwrite:statuscode"  = "403"
    }
  }

  response_parameters {
    status_code = "404"

    mappings = {
      "append:header.error" = "$stageVariables.environmentId"
    }
  }
}

References

Announcement.

Requires AWS SDK v1.36.17:

@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 8, 2021
@ghost ghost added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Jan 8, 2021
@ewbankkit ewbankkit self-assigned this Jan 9, 2021
@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
enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant