Skip to main content

DeleteBucketLifecycle

DeleteBucketLifecycle removes a bucket's lifecycle configuration - every rule in it, in one call. From then on, objects no longer expire, noncurrent versions are no longer removed and incomplete multipart uploads are no longer aborted on the basis of the deleted rules. Removing the last rule in the dashboard and saving does exactly the same. To change or remove only some rules, PutBucketLifecycleConfiguration takes the full set you want to keep. Lifecycle policies explains what the rules do.

Good to know on STRG
  • x-amz-expected-bucket-owner is welcome and has nothing to check: a key only ever reaches buckets of its own account.
  • The configuration belongs to the whole bucket, so an access key limited to a key prefix can still delete all of it.
  • A bucket in another region answers 404 NoSuchBucket rather than a redirect; the bucket's own regional endpoint reaches it.
Versions stay billed

Every bucket keeps all versions of its objects. Without a lifecycle rule that removes noncurrent versions, every version is billed as stored data until it is deleted. Keeping 30 days of old versions shows a rule that keeps this in check.

When you'd use it​

  • Keeping everything for a while. A team asked to preserve every old version for an audit can take the rules off a bucket in one call, and nothing is tidied away until new rules are put back.
  • Retiring a temporary setup. A bucket that once held scratch data under tmp/, with a rule expiring it after a few days, now holds data worth keeping; deleting the configuration stops the expiry.
  • Settings kept in code. A deploy script that manages each bucket's settings can return a bucket to having no rules at all with this one call, the same way the dashboard does when its last rule is removed.

Request​

DELETE /?lifecycle HTTP/1.1
Host: my-bucket.s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Path-style, the same request is DELETE /my-bucket?lifecycle on s3.eu-central-1.strg.com. Addressing in the S3 API overview has both styles.

Permissions​

The access key needs Manage lifecycle rules (bucket-lifecycle:write). A key limited to certain buckets works too, as long as this bucket is one of them. A key prefix does not narrow this operation, because the configuration belongs to the whole bucket. Access keys has every permission.

URI parameters​

NameTypeRequiredDescription
BucketStringYesThe bucket whose lifecycle configuration is deleted.
lifecycleFlagYesSelects the lifecycle subresource. Sent without a value.

STRG answers 501 NotImplemented to any other query parameter, so a client knows straight away. The X-Amz-* parameters of a presigned URL and the x-id parameter the JavaScript SDK adds are welcome.

Request headers​

NameTypeRequiredDescription
x-amz-expected-bucket-ownerStringNoWelcome, with nothing to check: an access key only ever reaches its own account's buckets.

Request body​

None.

Response​

A successful delete answers 204 No Content with no body. After it, GetBucketLifecycleConfiguration answers 404 NoSuchLifecycleConfiguration.

Response headers​

NameDescription
x-amz-request-idThe request ID, useful in a support request.

Response body​

None.

Errors​

These are the answers a client can get instead of 204, and the situation behind each.

CodeHTTP statusWhen
NoSuchBucket404The bucket does not exist, it is in a region other than the endpoint's, or the account stores nothing in this endpoint's region yet.
AccessDenied403The access key does not hold Manage lifecycle rules, or the bucket is outside its scope.
InvalidAccessKeyId403The access key does not exist, has expired or has been revoked - or it was created moments ago and is not yet usable in this region, where the account already stores data. A retry a moment later succeeds.
SignatureDoesNotMatch403The request signature does not match.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not take.
SlowDown503Too many requests at once. A retry after the Retry-After interval goes through.
ServiceUnavailable503A temporary failure. A retry of the same request is safe.

Differences from Amazon S3​

AspectAmazon S3STRG
Bucket in another region301 redirect with x-amz-bucket-region404 NoSuchBucket. The bucket's own regional endpoint reaches it.
x-amz-expected-bucket-ownerChecked against the bucket ownerWelcome, with nothing to check: a key only reaches its own account's buckets

Examples​

Removing every lifecycle rule from my-bucket:

aws s3api delete-bucket-lifecycle \
--bucket my-bucket \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1
View as Markdown