Skip to content
v2.273.0

DurableConfig Struct ​

Configuration for durable functions.

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

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 ​

executionTimeoutDurationexecution_timeoutDurationexecutionTimeoutDurationExecutionTimeoutDurationExecutionTimeoutDurationrequired#
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).

retentionPeriodDurationretention_periodDurationretentionPeriodDurationRetentionPeriodDurationRetentionPeriodDuration= 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.