8000 fix: change defaultNextLambda removalPolicy from DESTROY to RETAIN (#… · doctify/serverless-next.js@1baa444 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1baa444

Browse files
authored
fix: change defaultNextLambda removalPolicy from DESTROY to RETAIN (serverless-nextjs#2420)
1 parent f5c33ac commit 1baa444

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/serverless-components/nextjs-cdk-construct/__tests__/__snapshots__/snapshots.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,14 +1250,14 @@ Object {
12501250
"Type": "AWS::CloudFront::CachePolicy",
12511251
},
12521252
"StackNextLambdaCurrentVersion21F01F879970bafa5c9141f6152d4057c3ab8184": Object {
1253-
"DeletionPolicy": "Delete",
1253+
"DeletionPolicy": "Retain",
12541254
"Properties": Object {
12551255
"FunctionName": Object {
12561256
"Ref": "StackNextLambdaF64DCE99",
12571257
},
12581258
},
12591259
"Type": "AWS::Lambda::Version",
1260-
"UpdateReplacePolicy": "Delete",
1260+
"UpdateReplacePolicy": "Retain",
12611261
},
12621262
"StackNextLambdaCurrentVersionAliasliveB07D2AA0": Object {
12631263
"Properties": Object {
@@ -2999,14 +2999,14 @@ Object {
29992999
"Type": "AWS::CloudFront::CachePolicy",
30003000
},
30013001
"StackNextLambdaCurrentVersion21F01F87b5875487743b0e6b4f7058e417862406": Object {
3002-
"DeletionPolicy": "Delete",
3002+
"DeletionPolicy": "Retain",
30033003
"Properties": Object {
30043004
"FunctionName": Object {
30053005
"Ref": "StackNextLambdaF64DCE99",
30063006
},
30073007
},
30083008
"Type": "AWS::Lambda::Version",
3009-
"UpdateReplacePolicy": "Delete",
3009+
"UpdateReplacePolicy": "Retain",
30103010
},
30113011
"StackNextLambdaCurrentVersionAliasliveB07D2AA0": Object {
30123012
"Properties": Object {

packages/serverless-components/nextjs-cdk-construct/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class NextJSLambdaEdge extends Construct {
153153
description: `Default Lambda@Edge for Next CloudFront distribution`,
154154
handler: props.handler || "index.handler",
155155
currentVersionOptions: {
156-
removalPolicy: RemovalPolicy.DESTROY // destroy old versions
156+
removalPolicy: RemovalPolicy.RETAIN // retain old versions to prevent premature removal, cleanup via trigger later on
157157
},
158158
logRetention: logs.RetentionDays.THREE_DAYS,
159159
code: lambda.Code.fromAsset(

0 commit comments

Comments
 (0)
0