Skip to main content

PutBucketLifecycleConfiguration

PutBucketLifecycleConfiguration - Amazon Simple Storage Service

✅ Supported XML Elements

  • ID
  • Status
  • Prefix
  • Expiration
  • AbortIncompleteMultipartUpload

Example PutBucketLifecycleConfiguration request — Non-versioned bucket

PUT /mybucket?lifecycle=null HTTP/1.1
Host: [region].telnyxstorage.com
Accept: text/xml
Content-Type: application/xml
X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3
X-Amz-Date: 20230927T171857Z
Authorization: AWS4-HMAC-SHA256 Credential=YOUR_TELNYX_API_KEY/20230927/test/execute-api/aws4_request, SignedHeaders=accept;content-length;content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=bf5f1ef0813a985a4798dbbd63a722555f45a04de648f6bb7e975b4808974d80
Content-Length: 355

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>id2</ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>30</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>

Example PutBucketLifecycleConfiguration request - versioned bucket

PUT /versionedbucket?lifecycle=null HTTP/1.1
Host: [region].telnyxstorage.com
Accept: text/xml
Content-Type: application/xml
X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3
X-Amz-Date: 20230927T172104Z
Authorization: AWS4-HMAC-SHA256 Credential=YOUR_TELNYX_API_KEY/20230927/test/execute-api/aws4_request, SignedHeaders=accept;content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=a831851b8259ffb9e222ef5c755e5e44549972db7643d28f0570ac07b0600401
Content-Length: 436

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ID>DeleteAfterBecomingNonCurrent</ID>
<Filter>
<Prefix>logs/</Prefix>
</Filter>
<Status>Enabled</Status>
<NoncurrentVersionExpiration>
<NoncurrentDays>100</NoncurrentDays>
</NoncurrentVersionExpiration>
</Rule>
</LifecycleConfiguration>