class ParameterMapping
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Apigatewayv2.ParameterMapping |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#ParameterMapping |
Java | software.amazon.awscdk.services.apigatewayv2.ParameterMapping |
Python | aws_cdk.aws_apigatewayv2.ParameterMapping |
TypeScript (source) | aws-cdk-lib » aws_apigatewayv2 » ParameterMapping |
Represents a Parameter Mapping.
Example
import { HttpAlbIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const lb: elbv2.ApplicationLoadBalancer;
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
port: 80,
});
const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
defaultIntegration: new HttpAlbIntegration('DefaultIntegration', listener, {
parameterMapping: new apigwv2.ParameterMapping()
.appendHeader('header2', apigwv2.MappingValue.requestHeader('header1'))
.removeHeader('header1'),
}),
});
Initializer
new ParameterMapping()
Properties
Name | Type | Description |
---|---|---|
mappings | { [string]: string } | Represents all created parameter mappings. |
mappings
Type:
{ [string]: string }
Represents all created parameter mappings.
Methods
Name | Description |
---|---|
append | Creates a mapping to append a header. |
append | Creates a mapping to append a query string. |
custom(key, value) | Creates a custom mapping. |
overwrite | Creates a mapping to overwrite a header. |
overwrite | Creates a mapping to overwrite a path. |
overwrite | Creates a mapping to overwrite a querystring. |
remove | Creates a mapping to remove a header. |
remove | Creates a mapping to remove a querystring. |
static from | Creates a mapping from an object. |
Header(name, value)
appendpublic appendHeader(name: string, value: MappingValue): ParameterMapping
Parameters
- name
string
- value
Mapping
Value
Returns
Creates a mapping to append a header.
QueryString(name, value)
appendpublic appendQueryString(name: string, value: MappingValue): ParameterMapping
Parameters
- name
string
- value
Mapping
Value
Returns
Creates a mapping to append a query string.
custom(key, value)
public custom(key: string, value: string): ParameterMapping
Parameters
- key
string
- value
string
Returns
Creates a custom mapping.
Header(name, value)
overwritepublic overwriteHeader(name: string, value: MappingValue): ParameterMapping
Parameters
- name
string
- value
Mapping
Value
Returns
Creates a mapping to overwrite a header.
Path(value)
overwritepublic overwritePath(value: MappingValue): ParameterMapping
Parameters
- value
Mapping
Value
Returns
Creates a mapping to overwrite a path.
QueryString(name, value)
overwritepublic overwriteQueryString(name: string, value: MappingValue): ParameterMapping
Parameters
- name
string
- value
Mapping
Value
Returns
Creates a mapping to overwrite a querystring.
Header(name)
removepublic removeHeader(name: string): ParameterMapping
Parameters
- name
string
Returns
Creates a mapping to remove a header.
QueryString(name)
removepublic removeQueryString(name: string): ParameterMapping
Parameters
- name
string
Returns
Creates a mapping to remove a querystring.
Object(obj)
static frompublic static fromObject(obj: { [string]: MappingValue }): ParameterMapping
Parameters
- obj
{ [string]:
Mapping
Value }
Returns
Creates a mapping from an object.