Skip to content

Commit b4f42f5

Browse files
ran-isenbergRan Isenberg
andauthored
fix: enable key deletion and minimum days pending window (ran-isenberg#759)
Co-authored-by: Ran Isenberg <ran.isenberg@ranthebuilder.cloud>
1 parent d9dc305 commit b4f42f5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dev:
1111
npm ci
1212

1313
format:
14-
poetry run ruff check .
14+
poetry run ruff check . --fix
1515

1616
format-fix:
1717
poetry run ruff format .

cdk/service/monitoring.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import aws_cdk.aws_sns as sns
2-
from aws_cdk import CfnOutput, Duration, aws_apigateway
2+
from aws_cdk import CfnOutput, Duration, RemovalPolicy, aws_apigateway
33
from aws_cdk import aws_dynamodb as dynamodb
44
from aws_cdk import aws_iam as iam
55
from aws_cdk import aws_kms as kms
@@ -40,6 +40,8 @@ def _build_topic(self) -> sns.Topic:
4040
'MonitoringKey',
4141
description='KMS Key for SNS Topic Encryption',
4242
enable_key_rotation=True, # Enables automatic key rotation
43+
removal_policy=RemovalPolicy.DESTROY,
44+
pending_window=Duration.days(7),
4345
)
4446
topic = sns.Topic(self, f'{self.id_}alarms', display_name=f'{self.id_}alarms', master_key=key)
4547
# Grant CloudWatch permissions to publish to the SNS topic

0 commit comments

Comments
 (0)