본문 바로가기
AWS

[awscli] s3 버킷 라이브사이클 설정

by freesunny 2019. 10. 21.

# 설정 확인

# aws s3api get-bucket-lifecycle-configuration --bucket BUCKET_NAME
{
    "Rules": [
        {
            "ID""Convert IA",
            "Filter": {
                "Prefix"""
            },
            "Status""Enabled",
            "Transitions": [
                {
                    "Days"30,
                    "StorageClass""STANDARD_IA"
                }
            ],
            "AbortIncompleteMultipartUpload": {
                "DaysAfterInitiation"7
            }
        }
    ]
}
 

 

# 설정 삭제

# aws s3api  delete-bucket-lifecycle --bucket BUCKET_NAME

 

# 설정 추가

# aws s3api put-bucket-lifecycle-configuration --bucket BUCKET_NAME --lifecycle-configuration file://LIFECYCLE_POLICY.JSON