Skip to content

Commit

Permalink
Abort incomplete multipart uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Jan 14, 2025
1 parent f1591a0 commit bfe459e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions stack/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
removal_policy=RemovalPolicy.DESTROY,
lifecycle_rules=[
aws_s3.LifecycleRule(
abort_incomplete_multipart_upload_after=Duration.days(1),
expiration=Duration.days(sentinel_input_bucket_expiration_days),
expired_object_delete_marker=True,
noncurrent_version_expiration=Duration.days(1),
Expand All @@ -175,6 +176,7 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
removal_policy=RemovalPolicy.DESTROY,
lifecycle_rules=[
aws_s3.LifecycleRule(
abort_incomplete_multipart_upload_after=Duration.days(1),
expiration=Duration.days(sentinel_input_bucket_expiration_days),
expired_object_delete_marker=True,
noncurrent_version_expiration=Duration.days(1),
Expand All @@ -194,15 +196,25 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
"LandsatIntermediateBucket",
bucket_name=LANDSAT_INTERMEDIATE_OUTPUT_BUCKET,
removal_policy=RemovalPolicy.DESTROY,
lifecycle_rules=[aws_s3.LifecycleRule(expiration=Duration.days(60))],
lifecycle_rules=[
aws_s3.LifecycleRule(
abort_incomplete_multipart_upload_after=Duration.days(1),
expiration=Duration.days(60),
)
],
)

self.gibs_intermediate_output_bucket = aws_s3.Bucket(
self,
"GibsIntermediateBucket",
bucket_name=GIBS_INTERMEDIATE_OUTPUT_BUCKET,
removal_policy=RemovalPolicy.DESTROY,
lifecycle_rules=[aws_s3.LifecycleRule(expiration=Duration.days(60))],
lifecycle_rules=[
aws_s3.LifecycleRule(
abort_incomplete_multipart_upload_after=Duration.days(1),
expiration=Duration.days(60),
)
],
)

self.efs = Efs(self, "Efs", network=self.network)
Expand Down

0 comments on commit bfe459e

Please sign in to comment.