# DurableConfig

Configuration for durable functions.

Lambda durable functions allow for long-running executions with persistent state.

- Source: [`aws-lambda/lib/durable-config.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-lambda/lib/durable-config.ts#L8)
- Type last changed: v2.232.0 · 5 Dec 2025

## Example

```ts
const fn = new lambda.Function(this, 'MyFunction', {
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
  durableConfig: { executionTimeout: Duration.hours(1), retentionPeriod: Duration.days(30) }, // 1 hour timeout, 30 days retention
});
```

## Properties

- `executionTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) (required) — The amount of time that Lambda allows a durable function to run before stopping it.

  Must be between 1 and 31,622,400 seconds (366 days).

- `retentionPeriod`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.days(14) — The number of days after a durable execution is closed that Lambda retains its history.

  Must be between 1 and 90 days.

  The underlying configuration is expressed in whole numbers of days. Providing a Duration that
  does not represent a whole number of days will result in a runtime or deployment error.
