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 年前檢視次數 1200 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南