{{ result.summary.heading }}
{{ result.summary.primary }}
{{ result.summary.line }}
{{ badge.label }}
{{ marker.label }}
S3 lifecycle policy generator inputs
Start from a realistic pattern, then tune the filters and retention days before copying the policy.
Use the bucket that will receive the generated lifecycle configuration.
Keep this stable so reviews and AWS console history remain understandable.
Choose general purpose unless this is an S3 Express One Zone directory bucket.
Use Disabled when you want to stage a reviewed configuration before activation.
Use a trailing slash for folder-like prefixes such as logs/app/ or tmp/.
Each listed tag must exist on an object for the rule to apply.
{{ result.filterSummary }}
List ordered current-version transitions. Leave blank for expiration-only cleanup.
Expiration is destructive; keep it later than the final transition day.
days
Select whether the output should include noncurrent-version transition and expiration actions.
Use this for rollback-safe archives of overwritten versions.
Keep newer noncurrent versions when accidental overwrite recovery matters.
days
This threshold protects the most recent overwritten versions.
versions
Set days to 0 to omit multipart cleanup.
days after initiation
Use 128 KB or larger for most transition rules unless small-object transition cost is intentional.
KB
Leave blank for no upper size bound.
KB
Only emitted when there is no current-object expiration and no tag filter conflict.
Leave blank when the deployment workflow supplies this separately.
Use the bucket's region for CLI snippets.
Use a PascalCase logical ID when pasting into a larger template.
Use lower-case snake_case for clean Terraform references.
Use a compact value for screenshots or a larger value for handoff reviews.
rows
Adds short comments to XML, Terraform, and CLI outputs without changing the AWS lifecycle JSON payload.
{{ header }} Copy
{{ cell }}
No rows for the current lifecycle input.
Lifecycle timeline renderer unavailable.
Customize
Advanced
:

Introduction:

Objects in Amazon S3 often outlive the job that created them. Access logs, temporary exports, ingestion files, old document versions, and abandoned multipart uploads can sit in a bucket for years unless someone writes a retention rule for them. S3 lifecycle configuration is the way those storage decisions become automatic. A rule can move matching objects to a colder storage class, expire current objects, clean noncurrent versions, remove expired delete markers, or abort unfinished multipart uploads after a chosen age.

The important decision is not only when an object should be cheaper or gone. Lifecycle rules also decide which objects qualify. A broad rule can affect a whole bucket, while a narrower rule can match a prefix such as logs/app/, require one or more object tags, and limit the rule to a size range. Scope mistakes are expensive because a lifecycle configuration acts after it is applied. A missing tag can leave data behind, and a whole-bucket expiration rule can delete data that was never meant to be part of the cleanup plan.

S3 lifecycle diagram showing filter scope, object age checks, archive storage, expiration, noncurrent version cleanup, and multipart cleanup.

Versioning changes what deletion means. In a bucket without versioning, current-object expiration removes the object. In a versioning-enabled or versioning-suspended bucket, the current object and older versions can have separate actions. Noncurrent version cleanup can reduce storage and restore clutter, but it can also remove rollback points that a recovery process expects to keep.

Storage classes add another review step. S3 Standard-IA and S3 One Zone-IA require transition timing that respects the 30-day rule, while Glacier retrieval classes can have minimum storage durations that make early expiration a cost problem. Intelligent-Tiering is different because it is designed for changing access patterns, but it still needs a workload owner to confirm that monitoring and access expectations fit the data.

S3 lifecycle actions and review cautions
Lifecycle action Age clock Common review question
Current transition Days since object creation. Is the object old enough for the chosen storage class and retrieval pattern?
Current expiration Days since object creation. Can the data owner approve deletion after this retention period?
Noncurrent transition Days since a version became noncurrent. Will old versions still be available long enough for rollback?
Noncurrent expiration Noncurrent days plus optional retained-version count. How many newer noncurrent versions must remain before deletion starts?
Multipart cleanup Days since multipart upload initiation. Will stale upload parts be removed without depending on tags?

A useful lifecycle policy starts from a data-retention plan, not from a code format. Confirm who owns the bucket, which existing rules must stay, what legal hold or Object Lock controls may apply, and how restored data would be used before turning generated text into a live configuration.

How to Use This Tool:

Start with the preset closest to the retention pattern, then make the scope and destructive actions explicit before copying any generated output.

  1. Choose Lifecycle preset. Use the log archive, temporary cleanup, data lake tiering, version cleanup, multipart cleanup, or directory bucket pattern as a starting point rather than building every field from blank values.
  2. Enter Bucket name, Rule ID, Bucket type, and rule status. Pick Disabled when the policy should be staged for review before S3 performs actions.
  3. Define scope with Object key prefix, Tag filters, and object-size boundaries. Whole-bucket scope is valid only when the summary and ledger prove that every object in the bucket belongs in the rule.
  4. Add current-object transitions as rows of day, storage class, and note. Set Current-object expiration only when deletion after that age is intended.
  5. Set the Bucket versioning posture before entering noncurrent transition, noncurrent expiration, or retained-version values. Noncurrent actions are intentionally omitted when the selected bucket posture is not versioned.
  6. Use Abort incomplete multipart uploads for stale upload-part cleanup. If tag filters are present, the result should show a companion multipart rule because S3 does not allow that action with tag filters in the same rule.
  7. Open Advanced options only when the deployment artifact needs an expected bucket owner, AWS Region, CloudFormation logical ID, Terraform resource name, review comments, or a different row limit.
  8. Review Lifecycle JSON, XML, CloudFormation, Terraform, AWS CLI, Rule Ledger, Review Checks, and Lifecycle Timeline. Fix blocking issues first; treat warning notes as approval items rather than decoration.

Interpreting Results:

Lifecycle config ready means the current entries passed the local checks and produced at least one lifecycle rule. It does not mean the configuration is safe for production. The summary tells you how many rules were generated, how many current-object transitions are present, whether current expiration is active, and whether the output is for a general purpose or directory bucket.

Rule Ledger is the best review view before copy or download. It lists the rule ID, object stage, action, day or threshold, storage class, scope, and review note. When a generated artifact and the ledger disagree in your mind, trust the ledger to explain what the normalized policy is trying to do before inspecting the raw JSON.

  • Blocking input issues mean the artifacts should not be used until the named field or timing conflict is corrected.
  • AWS constraints warnings can still describe valid output, but they point to real review work such as directory bucket omissions, early deletion charge risk, disabled status, or the 128 KB transition default.
  • Lifecycle Timeline shows day-based actions for current objects, noncurrent versions, and multipart uploads, but legal retention, backup ownership, and restore tests must be checked outside the chart.
  • AWS CLI output uses put-bucket-lifecycle-configuration, so applying it can replace the bucket's existing lifecycle configuration unless the old and new rules are merged first.

Technical Details:

S3 stores lifecycle configuration as a list of rules. Each rule has an ID, status, filter, and one or more actions. A filter can be empty for bucket-wide scope, use a prefix, use a tag, combine several predicates with an And filter, or add object-size comparisons. Current-object actions count from object creation. Noncurrent version actions count from the moment a version stops being current. Multipart cleanup counts from upload initiation rather than object age.

Transition timing is governed by both the target storage class and the order of later actions. Standard-IA and One Zone-IA require at least day 30 before transition. If a later transition or expiration arrives before the selected storage class has met its minimum duration, the policy may be rejected locally or flagged for cost review. Expiration also has a hard ordering rule: current-object expiration must be later than the final current-object transition day.

Rule Core:

S3 lifecycle rule validation and generation behavior
Condition Rule behavior Review result
No transition, expiration, delete-marker cleanup, noncurrent action, or multipart cleanup No useful lifecycle rule can be generated. Blocking issue asks for at least one action.
Current transition day is below the storage-class transition minimum The transition row fails local validation. Blocking issue names the minimum day.
Later transition arrives before the previous class meets its minimum storage duration The ordered transition chain is rejected. Blocking issue asks for more time in the previous class.
Current expiration is earlier than or equal to the final transition day The object would be deleted before the final transition has meaning. Blocking issue asks for later expiration.
Tag-filtered rule also asks for multipart cleanup Multipart cleanup is split into a companion rule without tag filters. Warning explains why the companion rule exists.
Directory bucket mode is selected Transitions, tag filters, versioned-object actions, and delete-marker cleanup are omitted. Warnings name each omitted action type.

Storage Class Timing:

Storage class transition and minimum storage timing
Storage class Earliest transition day Minimum storage days used for review
S3 Standard-IA 30 30
S3 One Zone-IA 30 30
S3 Intelligent-Tiering 0 0
S3 Glacier Instant Retrieval 0 90
S3 Glacier Flexible Retrieval 0 90
S3 Glacier Deep Archive 0 180

Object Size Boundary Math:

S3 object-size filters use exclusive byte comparisons. The readable kilobyte entries are converted so a requested inclusive boundary still includes objects exactly at that kilobyte value.

ObjectSizeGreaterThan = minimum KB×1024-1 ObjectSizeLessThan = maximum KB×1024+1

A visible minimum of 128 KB becomes ObjectSizeGreaterThan 131071, so an object of exactly 131072 bytes still matches. A maximum of 1024 KB becomes ObjectSizeLessThan 1048577, so an object of exactly 1048576 bytes still matches.

The JSON, XML, CloudFormation, Terraform, and AWS CLI outputs represent the same lifecycle model as closely as each format allows. The command example writes a lifecycle JSON document and submits it with put-bucket-lifecycle-configuration. Because that operation replaces the bucket lifecycle configuration, existing bucket rules need to be carried into the new configuration before the command is used.

Limitations:

The generator creates review artifacts from the values entered in the browser. It does not inspect the live bucket, fetch existing lifecycle rules, check Object Lock, test IAM permissions, or apply the policy to AWS.

  • Generated expiration actions can delete production data after the policy is applied outside this page.
  • Storage prices, retrieval timing, minimum durations, and AWS service rules can change, so review current AWS documentation before rollout.
  • Bucket names, rule IDs, tags, account IDs, and regions typed into the form are reflected in generated text and downloads; avoid adding secrets or private operational notes to review comments.
  • Local checks catch common timing and formatting mistakes, but they are not a substitute for deployment review, change control, or account-specific policy checks.

Worked Examples:

Log archive with one-year retention

A platform team keeps the log archive preset, uses prefix logs/app/, keeps tags such as environment=prod and retention=standard, transitions current objects at day 30 and day 90, and expires current objects at day 365. Rule Ledger should show transition rows before current-object expiration, while Review Checks should still treat destructive expiration as an owner-approval item.

Version cleanup without deleting current documents

A documents bucket can leave current-object expiration at 0, set versioning posture to enabled, move noncurrent versions after 30 noncurrent days, expire them after 365 noncurrent days, and retain 5 newer noncurrent versions. The result should omit current-object deletion and show noncurrent transition plus noncurrent expiration rows, which should be reviewed against rollback needs.

Tag filters with multipart cleanup

If a rule is scoped by tags and Abort incomplete multipart uploads is set to 7, the generated configuration should include a companion cleanup rule without the tag filters. That warning is expected. If you need a single-rule configuration, remove the tag filter or remove multipart cleanup and handle stale parts with a separate reviewed rule.

FAQ:

Does the lifecycle JSON include the bucket name?

No. The lifecycle JSON is the configuration body. The bucket name appears in the command and infrastructure examples where those formats need to identify the bucket.

Why are transitions missing for a directory bucket?

Directory bucket lifecycle support is narrower. When directory bucket mode is selected, the result omits transitions, tag filters, versioned-object actions, and expired delete-marker cleanup.

Why did a 128 KB minimum become 131071 bytes?

S3 size filters use exclusive byte comparisons. The conversion uses 128 x 1024 - 1 so objects exactly 128 KB still match the intended minimum.

What does an early deletion charge warning mean?

A current-object expiration day may be too close to the final transition for the selected storage class. Review the suggested later day and the current AWS storage-class terms before applying the policy.

What should I do with blocking input issues?

Fix the listed fields before copying artifacts. Common causes include invalid bucket names, invalid tag rows, unsupported storage class values, transition timing conflicts, or no lifecycle action selected.

Glossary:

Lifecycle rule
An S3 configuration entry that matches objects and applies transition, expiration, noncurrent version, delete-marker, or multipart cleanup actions.
Filter
The rule scope, such as a prefix, tag set, object-size range, or combination of those predicates.
Noncurrent version
An older object version that stopped being current after a newer version or delete marker was created.
Transition
A lifecycle action that moves matching objects or versions to another S3 storage class.
Expiration
A lifecycle action that deletes current objects, old noncurrent versions, or expired delete markers when the rule conditions are met.
Directory bucket
An S3 Express One Zone bucket type with narrower lifecycle action support than a general purpose bucket.
Multipart cleanup
An action that aborts incomplete multipart uploads and removes stale uploaded parts after the configured initiation age.