Skip to content
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

s3: support TransitionDefaultMinimumObjectSize for life cycle #31777

Closed
1 of 2 tasks
go-to-k opened this issue Oct 16, 2024 · 2 comments · Fixed by #31778
Closed
1 of 2 tasks

s3: support TransitionDefaultMinimumObjectSize for life cycle #31777

go-to-k opened this issue Oct 16, 2024 · 2 comments · Fixed by #31778
Labels
@aws-cdk/aws-s3 Related to Amazon S3 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@go-to-k
Copy link
Contributor

go-to-k commented Oct 16, 2024

Describe the feature

TransitionDefaultMinimumObjectSize for lifecycles has been supported: https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-s3-default-minimum-object-size-lifecycle-transition-rules

Cfn doc: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html#cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize

Use Case

It can be possible to indicate which default minimum object size behavior is applied to the lifecycle configuration.

Proposed Solution

Add TransitionDefaultMinimumObjectSize to BucketProps.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.162.0

Environment details (OS name and version, etc.)

Mac

@go-to-k go-to-k added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2024
@github-actions github-actions bot added the @aws-cdk/aws-s3 Related to Amazon S3 label Oct 16, 2024
@go-to-k go-to-k changed the title s3: support TransitionDefaultMinimumObjectSize s3: support TransitionDefaultMinimumObjectSize for life cycle Oct 16, 2024
@ashishdhingra ashishdhingra self-assigned this Oct 16, 2024
@ashishdhingra ashishdhingra added p2 investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2024
@ashishdhingra
Copy link
Contributor

Although escape hatch could be workaround, this feature request fills the gap in L2 Bucket construct.

@ashishdhingra ashishdhingra added effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 16, 2024
@ashishdhingra ashishdhingra removed their assignment Oct 16, 2024
@mergify mergify bot closed this as completed in #31778 Oct 18, 2024
mergify bot pushed a commit that referenced this issue Oct 18, 2024
…#31778)

### Issue # (if applicable)

Closes #31777.

### Reason for this change



TransitionDefaultMinimumObjectSize for lifecycles has been supported. It can be possible to indicate which default minimum object size behavior is applied to the lifecycle configuration.

what's new: https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-s3-default-minimum-object-size-lifecycle-transition-rules

UserGuide: https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints

Cfn doc: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfiguration.html#cfn-s3-bucket-lifecycleconfiguration-transitiondefaultminimumobjectsize

API: https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-lifecycle-configuration.html

Still CFn documentation says “Property description not available”, so it is good to look at the API documentation for the description.

```
--transition-default-minimum-object-size (string)

Indicates which default minimum object size behavior is applied to the lifecycle configuration.

all_storage_classes_128K - Objects smaller than 128 KB will not transition to any storage class by default.
varies_by_storage_class - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB.
To customize the minimum object size for any transition you can add a filter that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body of your transition rule. Custom filters always take precedence over the default transition behavior.

Possible values:

varies_by_storage_class
all_storage_classes_128K
```

### Description of changes



Add `TransitionDefaultMinimumObjectSize` to BucketProps.

### Description of how you validated changes



Both unit and integ tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-s3 Related to Amazon S3 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants