> **Experimental**
>
> `@aws-cdk/aws-bedrock-agentcore-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# LambdaInterceptor

A Lambda-based interceptor for Gateway.

Interceptors allow you to run custom code during each invocation of your gateway:
- REQUEST interceptors execute before calling the target
- RESPONSE interceptors execute after the target responds

Extends: LambdaInterceptor
Implements: IInterceptor

- Source: [`lib/gateway/interceptor.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0-alpha.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/interceptor.ts#L100)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const function_: lambda.Function;
const lambdaInterceptor = bedrock_agentcore_alpha.LambdaInterceptor.forRequest(function_, /* all optional props */ {
  passRequestHeaders: false,
});
```

## Properties

- `interceptionPoint`: [InterceptionPoint](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.InterceptionPoint.html) — The interception point (REQUEST or RESPONSE).

## Methods

- `bind(_scope: Construct, gateway: IGateway): InterceptorBindConfig` — Binds this Lambda interceptor to a Gateway.

  This method:
  1. Grants the Gateway's IAM role permission to invoke the Lambda function
  2. Returns the CloudFormation configuration for this interceptor

  **Parameters**

  - `_scope` — The construct scope (currently unused, reserved for future extensions).
  - `gateway` — The gateway this interceptor is being bound to.

  **Returns:** Configuration for CloudFormation rendering

- `forRequest(lambdaFunction: IFunction, options?: InterceptorOptions): LambdaInterceptor // chainable` (static) — Create a REQUEST interceptor that executes before the gateway calls the target.

  **Important:** When this interceptor is added to a gateway, the gateway's IAM role
  will automatically be granted `lambda:InvokeFunction` permission on the specified
  Lambda function.

  **Parameters**

  - `lambdaFunction` — The Lambda function to invoke.
  - `options` — Optional configuration for the interceptor.

  **Returns:** A configured LambdaInterceptor for request interception

- `forResponse(lambdaFunction: IFunction, options?: InterceptorOptions): LambdaInterceptor // chainable` (static) — Create a RESPONSE interceptor that executes after the target responds.

  **Important:** When this interceptor is added to a gateway, the gateway's IAM role
  will automatically be granted `lambda:InvokeFunction` permission on the specified
  Lambda function.

  **Parameters**

  - `lambdaFunction` — The Lambda function to invoke.
  - `options` — Optional configuration for the interceptor.

  **Returns:** A configured LambdaInterceptor for response interception
