From 9258b17eec375e0c5c3f1acc15c3c0bb78d2e2f6 Mon Sep 17 00:00:00 2001 From: Roger Zhang Date: Thu, 21 Mar 2024 22:26:04 +0000 Subject: [PATCH 1/4] fix docstring --- packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts index cd78ca0520f4e..478472f12f271 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts @@ -63,7 +63,8 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 60 seconds * * Maximum value of 7 days * - * @default - the retention period configured on the stream + * @default -1 -- sets the maximum age to infinite. When infinite, Lambda never discards old records. + * The retention period configured on the stream now decides max age for records. */ readonly maxRecordAge?: Duration; From 357b0ac6493e38e1e95fd863821e09f0e21b6072 Mon Sep 17 00:00:00 2001 From: Roger Zhang Date: Fri, 22 Mar 2024 18:32:18 +0000 Subject: [PATCH 2/4] fix default for retryAttempts --- .../aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts index 478472f12f271..7d4c1209d2390 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts @@ -63,8 +63,9 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 60 seconds * * Maximum value of 7 days * - * @default -1 -- sets the maximum age to infinite. When infinite, Lambda never discards old records. - * The retention period configured on the stream now decides max age for records. + * @default -1 + * sets the maximum age to infinite. When infinite, Lambda never discards old records. + * The retention period configured on the stream now decides max age for records. */ readonly maxRecordAge?: Duration; @@ -74,7 +75,8 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 0 * * Maximum value of 10000 * - * @default - retry until the record expires + * @default -1 + * retry until the record expires */ readonly retryAttempts?: number; From 726ee6b7a85a0723c07ec346b75dabd07ba4afa3 Mon Sep 17 00:00:00 2001 From: Roger Zhang Date: Fri, 22 Mar 2024 18:50:26 +0000 Subject: [PATCH 3/4] fix lint --- packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts index 7d4c1209d2390..0525027058dbf 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts @@ -75,7 +75,7 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 0 * * Maximum value of 10000 * - * @default -1 + * @default -1 * retry until the record expires */ readonly retryAttempts?: number; From 5950f3f4ab3e0c958ab9ab31b5085a4050e05f48 Mon Sep 17 00:00:00 2001 From: Roger Zhang Date: Tue, 26 Mar 2024 17:41:27 +0000 Subject: [PATCH 4/4] address luca suggestion --- .../aws-lambda-event-sources/lib/stream.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts index 0525027058dbf..46b20d01e1787 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts @@ -63,9 +63,11 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 60 seconds * * Maximum value of 7 days * + * The default value is -1, which sets the maximum age to infinite. + * When the value is set to infinite, Lambda never discards old records. + * Record are valid until it expires in the event source. + * * @default -1 - * sets the maximum age to infinite. When infinite, Lambda never discards old records. - * The retention period configured on the stream now decides max age for records. */ readonly maxRecordAge?: Duration; @@ -75,8 +77,11 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps { * * Minimum value of 0 * * Maximum value of 10000 * + * The default value is -1, which sets the maximum number of retries to infinite. + * When MaximumRetryAttempts is infinite, Lambda retries failed records until + * the record expires in the event source. + * * @default -1 - * retry until the record expires */ readonly retryAttempts?: number;