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"
}
]
}