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

More than 1 year has passed since last update.

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"
        }
    ]
}
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.