From 34b273f78e7ac64c0613e04a1f1c085cd61cbb90 Mon Sep 17 00:00:00 2001 From: Chuck Daniels Date: Mon, 18 Mar 2024 14:35:11 -0400 Subject: [PATCH] Set 60-day expiration on intermediate buckets Fixes #271 --- stack/stack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stack/stack.py b/stack/stack.py index d31334e..1075786 100644 --- a/stack/stack.py +++ b/stack/stack.py @@ -170,6 +170,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: "LandsatIntermediateBucket", bucket_name=LANDSAT_INTERMEDIATE_OUTPUT_BUCKET, removal_policy=core.RemovalPolicy.DESTROY, + lifecycle_rules=[aws_s3.LifecycleRule(expiration=core.Duration.days(60))], ) self.gibs_intermediate_output_bucket = aws_s3.Bucket( @@ -177,6 +178,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: "GibsIntermediateBucket", bucket_name=GIBS_INTERMEDIATE_OUTPUT_BUCKET, removal_policy=core.RemovalPolicy.DESTROY, + lifecycle_rules=[aws_s3.LifecycleRule(expiration=core.Duration.days(60))], ) self.efs = Efs(self, "Efs", network=self.network)