Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sns): kms key is not deleted in integ.sns.ts #29664

Merged
merged 2 commits into from
Apr 1, 2024
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
}
],
"Version": "2012-10-17"
}
},
"PendingWindowInDays": 7
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"MyTopic86869434": {
"Type": "AWS::SNS::Topic",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Key } from 'aws-cdk-lib/aws-kms';
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { App, Stack, StackProps, RemovalPolicy, Duration } from 'aws-cdk-lib';
import { LoggingProtocol, Topic } from 'aws-cdk-lib/aws-sns';
import { ManagedPolicy, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';

class SNSInteg extends Stack {
constructor(scope: App, id: string, props?: StackProps) {
super(scope, id, props);

const key = new Key(this, 'CustomKey');
const key = new Key(this, 'CustomKey', {
pendingWindow: Duration.days(7),
removalPolicy: RemovalPolicy.DESTROY,
});

const topic = new Topic(this, 'MyTopic', {
topicName: 'fooTopic',
Expand Down