-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
S3: implement TransitionDefaultMinimumObjectSize for Lifecycle Configuration #12212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 59m 0s ⏱️ - 55m 1s Results for commit 31ba4f5. ± Comparison against base commit 952eb3e. This pull request removes 2365 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
tests/aws/services/s3/test_s3.py
Outdated
put_lifecycle_varies = aws_client.s3.put_bucket_lifecycle_configuration( | ||
Bucket=s3_bucket, | ||
LifecycleConfiguration=lfc, | ||
TransitionDefaultMinimumObjectSize="varies_by_storage_class", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consider using TransitionDefaultMinimumObjectSize.varies_by_storage_class
instead of string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit torn about this, because this variable is not exposed by boto3
itself but only generated from us, so people using boto3
do not have access to it and have to use hardcoded strings, so I figured that this is how a regular user would do it.
But I can also see the value in using the generated value from the specs, as I'm already doing it for StorageClass
😅 will update 👍
4d19592
to
31ba4f5
Compare
Motivation
As a follow up from #12145, there was a new field introduced for operation related to S3 Buckets
LifecycleConfiguration
.This fix allows us to now validate and return the field as well, even though we do not support Lifecycle transitions, some IaC providers might expect us to return it.
This is what the field is for:
See:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html#AmazonS3-PutBucketLifecycleConfiguration-request-header-TransitionDefaultMinimumObjectSize
https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-s3-default-minimum-object-size-lifecycle-transition-rules/
Changes