3 Answers
- Newest
- Most votes
- Most comments
0
I changed my mind, I'm using boto3 SDK and it worked correctly.
import boto3
s3 = boto3.resource('s3')
bucket_lifecycle_configuration = s3.BucketLifecycleConfiguration('my-bucket')
response = bucket_lifecycle_configuration.put(
LifecycleConfiguration={
'Rules': [
{
'ID': 'Move-To-Glacier',
'Prefix': '',
'Status': 'Enabled',
'Transitions': [
{
'Days': 365,
'StorageClass': 'GLACIER'
},
{
'Days': 1825,
'StorageClass': 'DEEP_ARCHIVE'
}
],
}
]
}
)
print(response)
0
There is typo in your "Transitions
" keyword. Refer the documentation here
So the correct format will be
{
"Rules": [
{
"ID": "MoveToGlacier",
"Prefix": "",
"Status": "Enabled",
"Transitions": [
{
"Days": 365,
"StorageClass": "GLACIER"
},
{
"Days": 1825,
"StorageClass": "DEEP_ARCHIVE"
}
]
}
]
}
0
Make sure you have an updated version of the CLI. Sometimes having an older version that does not know about "DEEP_ARCHIVE" will produce this type of error.
i'm latest version:
aws --version aws-cli/2.9.23 Python/3.9.11 Linux/5.4.72-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a month ago
Parameter validation failed: Unknown parameter in LifecycleConfiguration.Rules[0]: "Transitions", must be one of: Expiration, ID, Prefix, Status, Transition, NoncurrentVersionTransition, NoncurrentVersionExpiration, AbortIncompleteMultipartUpload.
The param is correct "Transition". This message i get by logs