Skip to content

Commit

Permalink
Ensure CMK key is cleaned up when test is torn down
Browse files Browse the repository at this point in the history
  • Loading branch information
biffgaut committed Dec 20, 2023
1 parent 8c956da commit acdabb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@
"Version": "2012-10-17"
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"testlambdasqsqueueDD178B7C": {
"Type": "AWS::SQS::Queue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

// Imports
import { App, Stack } from "aws-cdk-lib";
import { App, Stack, RemovalPolicy } from "aws-cdk-lib";
import { LambdaToSqs, LambdaToSqsProps } from "../lib";
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { generateIntegStackName } from '@aws-solutions-constructs/core';
Expand All @@ -29,7 +29,9 @@ const props: LambdaToSqsProps = {
handler: 'index.handler',
code: lambda.Code.fromAsset(`${__dirname}/lambda`)
},
enableEncryptionWithCustomerManagedKey: true
encryptionKeyProps: {
removalPolicy: RemovalPolicy.DESTROY
}
};

new LambdaToSqs(stack, 'test-lambda-sqs', props);
Expand Down

0 comments on commit acdabb4

Please sign in to comment.