class MappingValue
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGatewayv2.MappingValue |
Java | software.amazon.awscdk.services.apigatewayv2.MappingValue |
Python | aws_cdk.aws_apigatewayv2.MappingValue |
TypeScript (source) | @aws-cdk/aws-apigatewayv2 » MappingValue |
Implements
IMapping
Represents a Mapping Value.
Example
import { HttpAlbIntegration } from '@aws-cdk/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 (protected)
super(value: string)
Parameters
- value
string
Properties
Name | Type | Description |
---|---|---|
value | string | Represents a Mapping Value. |
static NONE | Mapping | Creates an empty mapping value. |
value
Type:
string
Represents a Mapping Value.
static NONE
Type:
Mapping
Creates an empty mapping value.
Methods
Name | Description |
---|---|
static context | Creates a context variable mapping value. |
static custom(value) | Creates a custom mapping value. |
static request | Creates a request body mapping value. |
static request | Creates a header mapping value. |
static request | Creates a request path mapping value. |
static request | Creates a request path parameter mapping value. |
static request | Creates a query string mapping value. |
static stage | Creates a stage variable mapping value. |
Variable(variableName)
static contextpublic static contextVariable(variableName: string): MappingValue
Parameters
- variableName
string
Returns
Creates a context variable mapping value.
static custom(value)
public static custom(value: string): MappingValue
Parameters
- value
string
Returns
Creates a custom mapping value.
Body(name)
static requestpublic static requestBody(name: string): MappingValue
Parameters
- name
string
Returns
Creates a request body mapping value.
Header(name)
static requestpublic static requestHeader(name: string): MappingValue
Parameters
- name
string
Returns
Creates a header mapping value.
Path()
static requestpublic static requestPath(): MappingValue
Returns
Creates a request path mapping value.
PathParam(name)
static requestpublic static requestPathParam(name: string): MappingValue
Parameters
- name
string
Returns
Creates a request path parameter mapping value.
QueryString(name)
static requestpublic static requestQueryString(name: string): MappingValue
Parameters
- name
string
Returns
Creates a query string mapping value.
Variable(variableName)
static stagepublic static stageVariable(variableName: string): MappingValue
Parameters
- variableName
string
Returns
Creates a stage variable mapping value.