Skip to content

Commit

Permalink
Update app.py to add destroy policy for bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
awsarippa authored Jan 17, 2024
1 parent 2b97ee8 commit 79ef5d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions s3-lambda-translate-cdk-python/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
encryption=s3.BucketEncryption.S3_MANAGED,
block_public_access=s3.BlockPublicAccess.BLOCK_ALL,
enforce_ssl=True,
removal_policy=cdk.RemovalPolicy.DESTROY,
auto_delete_objects=True,
)

# Replace the output bucket name with a preferred unique name, since S3 bucket names are globally unique.
Expand All @@ -39,6 +41,8 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
encryption=s3.BucketEncryption.S3_MANAGED,
block_public_access=s3.BlockPublicAccess.BLOCK_ALL,
enforce_ssl=True,
removal_policy=cdk.RemovalPolicy.DESTROY,
auto_delete_objects=True,
)

# Iam role to invoke lambda
Expand Down

0 comments on commit 79ef5d3

Please sign in to comment.