# RecursiveLoop

- Source: [`aws-lambda/lib/function.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-lambda/lib/function.ts#L161)
- Type last changed: v2.153.0 · 20 Aug 2024

## Example

```ts
const fn = new lambda.Function(this, 'MyFunction', {
  code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')),
  runtime: lambda.Runtime.JAVA_11,
  handler: 'example.Handler::handleRequest',
  recursiveLoop: lambda.RecursiveLoop.TERMINATE,
  });
```

## Members

| Member | Description |
| --- | --- |
| `ALLOW` | Allows the recursive loop to happen and does not terminate it. |
| `TERMINATE` | Terminates the recursive loop. |

## Referenced by

- [`FunctionOptions`](/v2/docs/aws-cdk-lib.aws_lambda.FunctionOptions).recursiveLoop
