# LambdaIntegration

Class · Stable

Integrates an AWS Lambda function to an API Gateway method.

Extends: [Integration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.Integration.html) › [AwsIntegration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.AwsIntegration.html) › LambdaIntegration

- Source: [`aws-apigateway/lib/integrations/lambda.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigateway/lib/integrations/lambda.ts#L57)

## Example

TypeScript:

```ts
   declare const resource: apigateway.Resource;
   declare const handler: lambda.Function;
   resource.addMethod('GET', new apigateway.LambdaIntegration(handler));
```

Python:

```python
# resource: apigateway.Resource
# handler: lambda.Function

resource.add_method("GET", apigateway.LambdaIntegration(handler))
```

Java:

```java
Resource resource;
Function handler;

resource.addMethod("GET", new LambdaIntegration(handler));
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Resource resource;
Function handler;

resource.AddMethod("GET", new LambdaIntegration(handler));
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var resource Resource
var handler Function

resource.AddMethod(jsii.String("GET"), apigateway.NewLambdaIntegration(handler))
```

## Initializer

TypeScript:

```ts
new LambdaIntegration(handler: IFunction, options?: LambdaIntegrationOptions)
```

Python:

```python
LambdaIntegration(handler: IFunction, options: typing.Optional[LambdaIntegrationOptions] = None)
```

Java:

```java
new LambdaIntegration(IFunction handler, LambdaIntegrationOptions options)
```

C#:

```csharp
new LambdaIntegration(IFunction handler, LambdaIntegrationOptions? options = null)
```

Go:

```go
NewLambdaIntegration(Handler IFunction, Options LambdaIntegrationOptions)
```

## Methods

- `bind(method: Method): IntegrationConfig` — Can be overridden by subclasses to allow the integration to interact with the method being integrated, access the REST API object, method ARNs, etc.
