How to use s3 life cycle policy for multiple buckets those starting with some fixed naming ?

0

I have multiple buckets those stating with name dataplatform-raw , I wanted to apply life cycle policy to transition the data to s3 intelligent tiering , though I am aware I can go to life cycle policy per bucket and create rule for the same , but is there way to automate this , for the buckets starting with dataplatform-raw should be transitioned to s3 intelligent tiering storage .

2개 답변
0

If i am able to understand the question right you want to transition the bucket to S3 intelligent tiering , I am not sure wether you can automate this or not. Amazon S3 has a global namespace. (i.e. No two S3 buckets can have the same name) so i am quite sure that this cannot be automated though i might be wrong But you can follow the link for the transition process.https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-intelligent-tiering.html

Manibh
답변함 2년 전
  • I also read this somewhere that S3 Buckets only support a single lifecycle configuration. Declaring multiple aws_s3_bucket_lifecycle_configuration resources to the same S3 Bucket will cause a perpetual difference in configuration.

0

The API to apply a lifecycle on configuration is "PutBucketLifecycleConfiguration, and it is applied on an individual bucket. S3 doesn't have a feature where you can apply a lifecycle configuration on multiple buckets at a time. This is however be achieved on the client end, where you can create a script which first gives you a list of all the buckets in your AWS account, then filter it for a common prefix. After that, you simple run the above API in a loop for the filtered list.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html

AWS
지원 엔지니어
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠