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 .

gefragt vor 2 Jahren1200 Aufrufe
2 Antworten
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
beantwortet vor 2 Jahren
  • 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
SUPPORT-TECHNIKER
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen