Skip to main content

Example 8: Priorities for S3 bucket lifecycle and ILM policy

Contributors netapp-perveilerk

Depending on your lifecycle configuration, objects follow the retention settings of either the S3 bucket lifecycle or an ILM policy.

Example of bucket lifecycle taking priority over ILM policy

ILM policy
  • Rule based on noncurrent-time reference: On Day 0, keep X copies for 20 days

  • Rule based on ingest-time reference (default): On Day 0, keep X copies for 50 days

Bucket Lifecycle
  • Filter: {Prefix: "docs/"}, Expiration: Days: 100, NoncurrentVersionExpiration: Days: 5

Result
  • An object named "docs/text" is ingested. It matches the bucket lifecycle filter of "docs/" prefix.

    • After 100 days a delete-marker is created and "docs/text" becomes noncurrent.

    • After 5 days, a total of 105 days since ingest, "docs/text" is deleted.

  • An object named "video/movie" is ingested. It does not match the filter and uses the ILM retention policy.

    • After 50 days a delete-marker is created and "video/movie" becomes noncurrent.

    • After 20 days, a total of 70 days since the ingest, "video/movie" is deleted.

Example of bucket lifecycle implicitly keeping-forever

ILM policy
  • Rule based on noncurrent-time reference: On Day 0, keep X copies for 20 days

  • Rule based on ingest-time reference (default): On Day 0, keep X copies for 50 days

Bucket Lifecycle
  • Filter: {Prefix: "docs/"}, Expiration: ExpiredObjectDeleteMarker: true

Result
  • An object named "docs/text" is ingested. It matches the bucket lifecycle filter of "docs/" prefix.

    The Expiration action applies only to expired delete markers, which implies keeping everything else forever (starting with "docs/").

    Delete markers that start with "docs/" are removed when they become expired.

  • An object named "video/movie" is ingested. It does not match the filter and uses the ILM retention policy.

    • After 50 days a delete-marker is created and "video/movie" becomes noncurrent.

    • After 20 days, a total of 70 days since the ingest, "video/movie" is deleted.

Example of using bucket lifecycle to duplicate ILM and clean up expired delete markers

ILM policy
  • Rule based on noncurrent-time reference: On Day 0, keep X copies for 20 days

  • Rule based on ingest-time reference (default): On Day 0, keep X copies for 50 days

Bucket Lifecycle
  • Filter: {}, Expiration: Days: 50, NoncurrentVersionExpiration: Days: 20

Result
  • The ILM policy is duplicated in the bucket lifecycle.

  • An object is ingested. No filter means that the bucket lifecycle applies to all objects and overrides the ILM retention settings.

    • After 50 days a delete-marker is created and the object becomes noncurrent.

    • After 20 days, a total of 70 days since the ingest, the noncurrent object is deleted and the delete-marker becomes expired.

    • After 30 days, a total of 100 days since the ingest, the expired delete-marker is deleted.