Skip to content
v2.275.0

MappingValue Class ​

Represents a Mapping Value.

Example ​

ts
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'),
  }),
});

Properties ​

Creates an empty mapping value.
valuestringvaluestrvalueStringValuestringValue*string#
Represents a Mapping Value.

Methods ​

contextVariable(variableName: string): MappingValue // chainable@staticmethod def context_variable(variable_name: str) -> MappingValuepublic static MappingValue contextVariable(String variableName)public static MappingValue ContextVariable(string variableName)func ContextVariable(VariableName *string) MappingValuestatic#
Creates a context variable mapping value.
custom(value: string): MappingValue // chainable@staticmethod def custom(value: str) -> MappingValuepublic static MappingValue custom(String value)public static MappingValue Custom(string value)func Custom(Value *string) MappingValuestatic#
Creates a custom mapping value.
requestBody(name: string): MappingValue // chainable@staticmethod def request_body(name: str) -> MappingValuepublic static MappingValue requestBody(String name)public static MappingValue RequestBody(string name)func RequestBody(Name *string) MappingValuestatic#
Creates a request body mapping value.
requestHeader(name: string): MappingValue // chainable@staticmethod def request_header(name: str) -> MappingValuepublic static MappingValue requestHeader(String name)public static MappingValue RequestHeader(string name)func RequestHeader(Name *string) MappingValuestatic#
Creates a header mapping value.
requestPath(): MappingValue // chainable@staticmethod def request_path() -> MappingValuepublic static MappingValue requestPath()public static MappingValue RequestPath()func RequestPath() MappingValuestatic#
Creates a request path mapping value.
requestPathParam(name: string): MappingValue // chainable@staticmethod def request_path_param(name: str) -> MappingValuepublic static MappingValue requestPathParam(String name)public static MappingValue RequestPathParam(string name)func RequestPathParam(Name *string) MappingValuestatic#
Creates a request path parameter mapping value.
requestQueryString(name: string): MappingValue // chainable@staticmethod def request_query_string(name: str) -> MappingValuepublic static MappingValue requestQueryString(String name)public static MappingValue RequestQueryString(string name)func RequestQueryString(Name *string) MappingValuestatic#
Creates a query string mapping value.
stageVariable(variableName: string): MappingValue // chainable@staticmethod def stage_variable(variable_name: str) -> MappingValuepublic static MappingValue stageVariable(String variableName)public static MappingValue StageVariable(string variableName)func StageVariable(VariableName *string) MappingValuestatic#
Creates a stage variable mapping value.