Edit bucket lifecycle rules
Lifecycle rules let you schedule object expiration, storage class changes and cleanup of older versions or incomplete multipart uploads. The service runs these rules even when S3Client is closed.
Before saving, check existing objects: they may meet a new rule’s conditions as soon as it is saved. Expiring a noncurrent version permanently deletes it. On Amazon S3, current-object expiration depends on versioning: it may create a delete marker or delete a null version. The service performs these actions later. Amazon S3 expiration documentation.
Prepare the editor
Open File > Accounts…, select the account, click Edit…, then open Capabilities. Under Lifecycle, configure support for reading, writing and deleting the configuration, together with the policy assigned to this bucket. Features, Limits and Assignments describe allowed filters, actions and combinations. The Storage classes policy defines transition destinations and constraints. Use settings that match the service.
These settings grant no permissions. Amazon S3 requires s3:GetLifecycleConfiguration for reading and s3:PutLifecycleConfiguration for changes. Lifecycle appears for a single general purpose bucket when reading is configured. Without writing support, rules can be viewed but not edited. Delete configuration remains available when deletion support is enabled and a remote configuration exists. A reading error prevents editing.
- In the S3 pane, select the bucket.
- Open Properties > Lifecycle and wait for the configuration to load.
- Select an entry in Lifecycle rules to inspect its filters and actions.
Add a rule and define its scope
Click Add, then enter Rule name. If supplied, the name must be unique and no longer than 255 characters. A configuration contains 1 to 1,000 rules; each rule, including disabled rules, must have at least one valid action.
A new rule is enabled by default if the account policy allows that status; it is disabled if that is the only permitted status. To prepare an enabled rule without triggering its actions after saving, use Disable when the policy allows it. Changes remain local until you click OK in the properties.
Under Filters, the following conditions are combined when the policy permits:
| Condition | Effect |
|---|---|
| Prefix | Selects objects whose key starts with the entered text, such as logs/. Wildcards are not interpreted. |
| Minimum size | Selects objects strictly larger than the specified size. |
| Maximum size | Selects objects strictly smaller than the specified size. |
Sizes are integers in B, KiB, MiB, GiB or TiB, using binary units. The lower bound must be smaller than the upper bound. With no condition, the rule applies to all eligible objects if the policy allows it.
Each bound accepts values from 0 to 50 TiB, or 54,975,581,388,800 bytes. Select Minimum size or Maximum size to apply the corresponding bound.
To use both bounds in one rule, the account policy must enable Combined minimum and maximum object sizes, both size filters and AND combinations under Account > Capabilities > Lifecycle > Features. Without this combination, selecting one bound makes the other unavailable; each bound remains usable separately if supported by the service.
Under Tags, click Add, then edit Key and Value in the list. These filters match object tags, not bucket tags. Up to 10 conditions are accepted, possibly fewer depending on the policy. Keys must be nonempty and unique with case taken into account; values may be empty. All configured tags and other conditions must match. Select a row and click Remove to remove it.
Tag filters cannot be combined with incomplete multipart upload cleanup or Expired delete marker. Other combinations and limits depend on the account policy; resolve the displayed diagnostic before saving.
Configure actions
Current versions
Under Current versions, click Add transition or Add expiration. In Lifecycle action, choose Trigger or Type, enter its parameters and click OK.
- After days uses object age. Days must be at least 0 for a transition and at least 1 for expiration.
- At a date uses a fixed Date, when supported.
- Expired delete marker, available for expiration when supported, removes a delete marker that is the only remaining entry for its key.
- A transition also requires Destination, a storage class allowed by the policy.
Day-count fields accept up to 2,147,483,647 days; the service may impose lower limits. Date is displayed as yyyy-MM-dd and saved at midnight UTC. A past date may make matching objects immediately eligible.
A rule cannot mix day-based and date-based schedules for current versions. Two transitions cannot use the same day count or date. Storage class constraints may require a minimum age or minimum time in the previous class. The editor also checks consistency between transitions and expiration.
A transition to an archive class may require restoration before reading. Transitions and minimum storage durations may also incur charges. See storage classes and archives before choosing the destination.
Noncurrent versions
Previous versions actions require a bucket with versioning enabled or suspended. Click Add transition or Add expiration, then enter Days, at least 1, measured from when a version became noncurrent.
When available, Retain newer noncurrent versions retains 1 to 100 newer noncurrent versions. The action then waits for both the age threshold and the version count to be exceeded. A transition also needs Destination. Support for multiple transitions and combined action types depends on the policy.
Two noncurrent-version transitions cannot use the same day count.
Incomplete uploads and transition size defaults
Under Maintenance, select Abort incomplete multipart uploads, then enter at least 1 day from upload initiation. The service deletes the parts and the upload can no longer resume.
Default minimum object size for transitions applies to the whole configuration:
- Service default lets the service choose.
- Block all transitions below 128 KiB blocks transitions of objects smaller than 128 KiB to any class by default.
- Allow Glacier Flexible Retrieval and Deep Archive below 128 KiB allows these small objects to transition to Glacier Flexible Retrieval or Deep Archive by default.
Explicit values appear according to the policy. This setting defines default behavior. On Amazon S3, explicit rule size filters take precedence and can allow transitions below 128 KiB. See AWS transition documentation.
Edit, disable or delete rules
Select a rule to change its fields. Duplicate copies its filters and actions; give the copy a unique name. Disable or Enable changes its status. In action tables, Edit opens the selected action and Remove deletes it.
Remove beside the rule list removes the rule after confirmation. Delete configuration prepares complete configuration deletion. Disabling or deleting rules does not restore objects or versions already deleted or transitioned.
Removing the last rule also prepares complete configuration deletion, with confirmation after OK; deletion support is required.
- Check the rules, their status and any diagnostics.
- Click OK in the properties.
- Confirm complete deletion if requested.
- After the operation, reopen Lifecycle to check the configuration.
If S3Client cannot represent the remote document, it displays The existing lifecycle configuration contains unsupported data and cannot be edited. and does not show a partial rule list. You can prepare a new configuration with Add, then confirm Replace uneditable lifecycle configuration after OK, or use Delete configuration when available. Replacement discards the complete remote document, including elements not displayed.
S3Client rereads the configuration before writing. In Lifecycle configuration changed, Yes replaces the remote configuration; No reloads it and discards your local changes. Another client can still change the configuration between this check and saving. If verification fails, restore access and reopen the properties. After changing account settings, close and reopen the properties.
When you change several tabs, operations are applied sequentially. An earlier success is not rolled back if a later operation fails; check which settings were actually saved before trying again.
On Amazon S3, noncurrent-version expiration does not delete an Object Lock-protected version. See Object Lock.
Service constraints and paired rules
The account policy determines the allowed rule statuses and bucket versioning states. Disable is unavailable when the service accepts only enabled rules. If the policy supports only certain versioning states, S3Client must know a compatible state before saving the configuration.
With Require paired expiration rules, an After days expiration and an Expired delete marker expiration must appear in separate rules with identical filters and statuses. Select a rule, then click Add paired rule to the right of the list. For expiration by days, this adds the cleanup rule; for marker cleanup, it opens Lifecycle action to enter the paired expiration delay. If the companion already exists, it is selected instead. Check both rules before clicking OK. Changing a filter or removing only one rule can make the configuration invalid.
The Backblaze B2 preset applies this constraint. Select Prefix and leave its value empty to cover the entire bucket. Identical and nested prefixes are accepted. Backblaze may rename the cleanup rule when the configuration is read back; its identifier is not a pairing requirement when writing. Dates, tags, size filters, transitions and retained-version counts remain unavailable in this preset.