Feature Proposal
Allow specifying mapping values when providing parameters to an API Gateway integration. This would allow configurations like this (that can be created via the AWS console) to be created in serverless:

Description
Currently, request parameters can be specified in AWS API Gateway integrations as part of request/parameters. The value provided for each parameter indicates whether it is required or not.
events:
- http:
path: /test/path
method: get
integration: http
request:
uri: https://some-backend.uri/path
parameters:
querystrings:
value1: true
value2: false
headers:
X-Custom-Header: false
This is then used in two places in the resulting CloudFormation template:
- In the
RequestParameters element of the AWS::ApiGateway::Method where the "requiredness" of each parameter is declared.
- In the
RequestParameters element of the method's Integration element where currently the parameter value is always the full "path" of the parameter (method.request.header.X-Venga-Api-Host for example).
The first usage doesn't need to be changed; it's the second that allows mapping of a different value.
A solution would be to enhance the configuration to allow specifying a mapping value in addition to whether or not the parameter is required:
events:
- http:
path: /test/path
method: get
integration: http
request:
uri: https://some-backend.uri/path
parameters:
querystrings:
value1: true
value2: false
headers:
X-Custom-Header:
required: false
mappedValue: context.domainName
This would then update the output for the second section of the CloudFormation template. The ability to only specify whether the parameter is required would also be retained for backward compatibility and simplicity where mapping is not desired.
I have a prototype of this change working if this is something that would be accepted into the project.
Feature Proposal
Allow specifying mapping values when providing parameters to an API Gateway integration. This would allow configurations like this (that can be created via the AWS console) to be created in serverless:

Description
Currently, request parameters can be specified in AWS API Gateway integrations as part of request/parameters. The value provided for each parameter indicates whether it is required or not.
This is then used in two places in the resulting CloudFormation template:
RequestParameterselement of theAWS::ApiGateway::Methodwhere the "requiredness" of each parameter is declared.RequestParameterselement of the method'sIntegrationelement where currently the parameter value is always the full "path" of the parameter (method.request.header.X-Venga-Api-Hostfor example).The first usage doesn't need to be changed; it's the second that allows mapping of a different value.
A solution would be to enhance the configuration to allow specifying a mapping value in addition to whether or not the parameter is required:
This would then update the output for the second section of the CloudFormation template. The ability to only specify whether the parameter is required would also be retained for backward compatibility and simplicity where mapping is not desired.
I have a prototype of this change working if this is something that would be accepted into the project.