2

Does the AWS Terraform provider support Parameter Mapping for API Gateway V2 HTTP APIs? Specifically I want to overwrite the path of an incoming request before forwarding it to a private integration. I can't seem to find a resource that allows me to specify parameter mapping under the aws_apigatewayv2 Terraform AWS provider resources.

I'm after the Terraform that would allow me set up the equivalent of setting up the below via the Console.

Equivalent from the AWS Console

Thanks in advance

1 Answer 1

3

This is set through request_parameters.

To check its form, you can first create it using AWS console, and then run AWS CLI

aws  apigatewayv2 get-integration  --api-id <id> --integration-id <id>

This returns (in my test) an output which shows RequestParameters as set in AWS console:

{
    "ConnectionType": "INTERNET",
    "IntegrationId": "rvy1o1c",
    "IntegrationMethod": "ANY",
    "IntegrationType": "HTTP_PROXY",
    "IntegrationUri": "https://www.example.com/path/parts",
    "PayloadFormatVersion": "1.0",
    "RequestParameters": {
        "overwrite:path": "newpath"
    },
    "TimeoutInMillis": 30000
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, and good tip for getting the format. I was thrown off because the terraform documentation says RequestParameters is only used by Websocket APIs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.