Skip to content

Commit 6bf84aa

Browse files
authored
Create separate lifecycle rules for expired_object_delete_marker (#307)
Fixes #305
1 parent 51aaacb commit 6bf84aa

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

stack/stack.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,15 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
160160
bucket_name=SENTINEL_INPUT_BUCKET,
161161
removal_policy=RemovalPolicy.DESTROY,
162162
lifecycle_rules=[
163+
# Setting expired_object_delete_marker cannot be done within a
164+
# lifecycle rule that also specifies expiration, expiration_date, or
165+
# tag_filters.
166+
aws_s3.LifecycleRule(expired_object_delete_marker=True),
163167
aws_s3.LifecycleRule(
164168
abort_incomplete_multipart_upload_after=Duration.days(1),
165169
expiration=Duration.days(sentinel_input_bucket_expiration_days),
166-
expired_object_delete_marker=True,
167170
noncurrent_version_expiration=Duration.days(1),
168-
)
171+
),
169172
],
170173
)
171174

@@ -175,12 +178,15 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None:
175178
bucket_name=SENTINEL_INPUT_BUCKET_HISTORIC,
176179
removal_policy=RemovalPolicy.DESTROY,
177180
lifecycle_rules=[
181+
# Setting expired_object_delete_marker cannot be done within a
182+
# lifecycle rule that also specifies expiration, expiration_date, or
183+
# tag_filters.
184+
aws_s3.LifecycleRule(expired_object_delete_marker=True),
178185
aws_s3.LifecycleRule(
179186
abort_incomplete_multipart_upload_after=Duration.days(1),
180187
expiration=Duration.days(sentinel_input_bucket_expiration_days),
181-
expired_object_delete_marker=True,
182188
noncurrent_version_expiration=Duration.days(1),
183-
)
189+
),
184190
],
185191
)
186192

0 commit comments

Comments
 (0)