LoginSignup
3
2

More than 5 years have passed since last update.

S3の全バケットのライフサイクルを見るためのワンライナー

Last updated at Posted at 2014-03-11

用途

どのバケットがいつGlacierに移されていつ削除されるのかなど、忘れてしまいがちなので、
それをすぐに簡単に見たいときに使います。

準備

前提として、aws-cli のセットアップが完了している必要があります。
http://aws.amazon.com/jp/cli/

コマンド

$ for bucket in `aws s3 ls | cut -d " " -f 3`; do echo "\n$bucket"; aws s3api get-bucket-lifecycle --bucket $bucket; done

ライフサイクルが設定されていないと、下記のようなメッセージが出ます。

A client error (NoSuchLifecycleConfiguration) occurred: The lifecycle configuration does not exist
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2