HttpLambdaIntegrationProps Struct
Lambda Proxy integration properties.
Example
ts
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const booksDefaultFn: lambda.Function;
const httpApi = new apigwv2.HttpApi(this, 'HttpApi');
const getBooksIntegration = new HttpLambdaIntegration('GetBooksIntegration', booksDefaultFn, {
scopePermissionToRoute: false,
});
const createBookIntegration = new HttpLambdaIntegration('CreateBookIntegration', booksDefaultFn, {
scopePermissionToRoute: false,
});
httpApi.addRoutes({
path: '/books',
methods: [ apigwv2.HttpMethod.GET ],
integration: getBooksIntegration,
});
httpApi.addRoutes({
path: '/books',
methods: [ apigwv2.HttpMethod.POST ],
integration: createBookIntegration,
});
Properties
parameterMappingoptionalParameterMappingparameter_mappingoptionalParameterMappingparameterMappingoptionalParameterMappingParameterMappingoptionalParameterMappingParameterMappingoptionalParameterMapping#Specifies how to transform HTTP requests before sending them to the backend.
Default: undefined requests are sent to the backend unmodified
payloadFormatVersionoptionalPayloadFormatVersionpayload_format_versionoptionalPayloadFormatVersionpayloadFormatVersionoptionalPayloadFormatVersionPayloadFormatVersionoptionalPayloadFormatVersionPayloadFormatVersionoptionalPayloadFormatVersion= PayloadFormatVersion.VERSION_2_0#Version of the payload sent to the lambda handler.
scopePermissionToRouteoptionalbooleanscope_permission_to_routeoptionalboolscopePermissionToRouteoptionalBooleanScopePermissionToRouteoptionalboolScopePermissionToRouteoptional*bool= true#Scope the permission for invoking the AWS Lambda down to the specific route associated with this integration.
If this is set to false, the permission will allow invoking the AWS Lambda from any route. This is useful for reducing the AWS Lambda policy size for cases where the same AWS Lambda function is reused for many integrations.