Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

fix: Change defaultNextLambda removalPolicy from DESTROY to RETAIN #2420

Merged
merged 2 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1250,14 +1250,14 @@ Object {
"Type": "AWS::CloudFront::CachePolicy",
},
"StackNextLambdaCurrentVersion21F01F879970bafa5c9141f6152d4057c3ab8184": Object {
"DeletionPolicy": "Delete",
"DeletionPolicy": "Retain",
"Properties": Object {
"FunctionName": Object {
"Ref": "StackNextLambdaF64DCE99",
},
},
"Type": "AWS::Lambda::Version",
"UpdateReplacePolicy": "Delete",
"UpdateReplacePolicy": "Retain",
},
"StackNextLambdaCurrentVersionAliasliveB07D2AA0": Object {
"Properties": Object {
Expand Down Expand Up @@ -2999,14 +2999,14 @@ Object {
"Type": "AWS::CloudFront::CachePolicy",
},
"StackNextLambdaCurrentVersion21F01F87b5875487743b0e6b4f7058e417862406": Object {
"DeletionPolicy": "Delete",
"DeletionPolicy": "Retain",
"Properties": Object {
"FunctionName": Object {
"Ref": "StackNextLambdaF64DCE99",
},
},
"Type": "AWS::Lambda::Version",
"UpdateReplacePolicy": "Delete",
"UpdateReplacePolicy": "Retain",
},
"StackNextLambdaCurrentVersionAliasliveB07D2AA0": Object {
"Properties": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class NextJSLambdaEdge extends Construct {
description: `Default Lambda@Edge for Next CloudFront distribution`,
handler: "index.handler",
currentVersionOptions: {
removalPolicy: RemovalPolicy.DESTROY // destroy old versions
removalPolicy: RemovalPolicy.RETAIN // retain old versions to prevent premature removal, cleanup via trigger later on
},
logRetention: logs.RetentionDays.THREE_DAYS,
code: lambda.Code.fromAsset(
Expand Down