4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[aws-cli]Amazon S3のバケットに、ストレージクラス「Standard – IA」を適応する

Posted at

json出力

aws s3api put-bucket-lifecycle-configuration --generate-cli-skeleton > set_s3_standard_ia_lifecyclepolicy_config.json
s3_standard_ia_lifecyclepolicy_config.json
{
    "Bucket": "image_test_bucket",
    "LifecycleConfiguration": {
        "Rules": [
            {
                "ID": "test_STANDARD_IA",
                "Prefix": "",
                "Status": "Enabled",
                "Transitions": [
                    {
                        "Days": 30,
                        "StorageClass": "STANDARD_IA"
                    }
                ]
            }
        ]
    }
}

実行

aws s3api put-bucket-lifecycle-configuration --cli-input-json file://s3_standard_ia_lifecyclepolicy_config.json

確認

aws s3api get-bucket-lifecycle-configuration --bucket image_test_bucket
{
    "Rules": [
        {
            "Status": "Enabled",
            "Prefix": "",
            "Transitions": [
                {
                    "Days": 30,
                    "StorageClass": "STANDARD_IA"
                }
            ],
            "ID": "test_STANDARD_IA"
        }
    ]
}
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?