# HttpLambdaIntegrationProps

Lambda Proxy integration properties.

Used as props by: [HttpLambdaIntegration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_integrations.HttpLambdaIntegration.html)

- Source: [`aws-apigatewayv2-integrations/lib/http/lambda.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/http/lambda.ts#L20)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

TypeScript:

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

Python:

```python
from aws_cdk.aws_apigatewayv2_integrations import HttpLambdaIntegration

# books_default_fn: lambda.Function

http_api = apigwv2.HttpApi(self, "HttpApi")

get_books_integration = HttpLambdaIntegration("GetBooksIntegration", books_default_fn,
    scope_permission_to_route=False
)
create_book_integration = HttpLambdaIntegration("CreateBookIntegration", books_default_fn,
    scope_permission_to_route=False
)

http_api.add_routes(
    path="/books",
    methods=[apigwv2.HttpMethod.GET],
    integration=get_books_integration
)

http_api.add_routes(
    path="/books",
    methods=[apigwv2.HttpMethod.POST],
    integration=create_book_integration
)
```

Java:

```java
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpLambdaIntegration;

Function booksDefaultFn;

HttpApi httpApi = new HttpApi(this, "HttpApi");

HttpLambdaIntegration getBooksIntegration = HttpLambdaIntegration.Builder.create("GetBooksIntegration", booksDefaultFn)
        .scopePermissionToRoute(false)
        .build();
HttpLambdaIntegration createBookIntegration = HttpLambdaIntegration.Builder.create("CreateBookIntegration", booksDefaultFn)
        .scopePermissionToRoute(false)
        .build();

httpApi.addRoutes(AddRoutesOptions.builder()
        .path("/books")
        .methods(List.of(HttpMethod.GET))
        .integration(getBooksIntegration)
        .build());

httpApi.addRoutes(AddRoutesOptions.builder()
        .path("/books")
        .methods(List.of(HttpMethod.POST))
        .integration(createBookIntegration)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AwsApigatewayv2Integrations;

Function booksDefaultFn;

var httpApi = new HttpApi(this, "HttpApi");

var getBooksIntegration = new HttpLambdaIntegration("GetBooksIntegration", booksDefaultFn, new HttpLambdaIntegrationProps {
    ScopePermissionToRoute = false
});
var createBookIntegration = new HttpLambdaIntegration("CreateBookIntegration", booksDefaultFn, new HttpLambdaIntegrationProps {
    ScopePermissionToRoute = false
});

httpApi.AddRoutes(new AddRoutesOptions {
    Path = "/books",
    Methods = new [] { HttpMethod.GET },
    Integration = getBooksIntegration
});

httpApi.AddRoutes(new AddRoutesOptions {
    Path = "/books",
    Methods = new [] { HttpMethod.POST },
    Integration = createBookIntegration
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"

var booksDefaultFn Function

httpApi := apigwv2.NewHttpApi(this, jsii.String("HttpApi"))

getBooksIntegration := awscdk.NewHttpLambdaIntegration(jsii.String("GetBooksIntegration"), booksDefaultFn, &HttpLambdaIntegrationProps{
	ScopePermissionToRoute: jsii.Boolean(false),
})
createBookIntegration := awscdk.NewHttpLambdaIntegration(jsii.String("CreateBookIntegration"), booksDefaultFn, &HttpLambdaIntegrationProps{
	ScopePermissionToRoute: jsii.Boolean(false),
})

httpApi.AddRoutes(&AddRoutesOptions{
	Path: jsii.String("/books"),
	Methods: []HttpMethod{
		apigwv2.HttpMethod_GET,
	},
	Integration: getBooksIntegration,
})

httpApi.AddRoutes(&AddRoutesOptions{
	Path: jsii.String("/books"),
	Methods: []HttpMethod{
		apigwv2.HttpMethod_POST,
	},
	Integration: createBookIntegration,
})
```

## Properties

- `parameterMapping`: [ParameterMapping](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.ParameterMapping.html) — Specifies how to transform HTTP requests before sending them to the backend.

  **Default:** undefined requests are sent to the backend unmodified

- `payloadFormatVersion`: [PayloadFormatVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.PayloadFormatVersion.html) = PayloadFormatVersion.VERSION_2_0 — Version of the payload sent to the lambda handler.

- `scopePermissionToRoute`: boolean = 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.

- `timeout`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(29) — The maximum amount of time an integration will run before it returns without a response.

  Must be between 50 milliseconds and 29 seconds.
