class MappingValue
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.MappingValue |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#MappingValue |
![]() | software.amazon.awscdk.services.apigatewayv2.MappingValue |
![]() | aws_cdk.aws_apigatewayv2.MappingValue |
![]() | aws-cdk-lib » aws_apigatewayv2 » MappingValue |
Implements
IMapping
Represents a Mapping Value.
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 (protected)
super(value: string)
Parameters
- value
string
— Represents a Mapping Value.
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. |
static contextVariable(variableName)
public 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.
static requestBody(name)
public static requestBody(name: string): MappingValue
Parameters
- name
string
Returns
Creates a request body mapping value.
static requestHeader(name)
public static requestHeader(name: string): MappingValue
Parameters
- name
string
Returns
Creates a header mapping value.
static requestPath()
public static requestPath(): MappingValue
Returns
Creates a request path mapping value.
static requestPathParam(name)
public static requestPathParam(name: string): MappingValue
Parameters
- name
string
Returns
Creates a request path parameter mapping value.
static requestQueryString(name)
public static requestQueryString(name: string): MappingValue
Parameters
- name
string
Returns
Creates a query string mapping value.
static stageVariable(variableName)
public static stageVariable(variableName: string): MappingValue
Parameters
- variableName
string
Returns
Creates a stage variable mapping value.