Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • Overview
    • Registry
    • Lifecycle policy
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events

In this article:

  • Types of rules
  • KEEP
  • HARD_DELETE
  • SOFT_DELETE
  • Rule filters
  • Applying policies
  • Rule object (LifecycleRule)
  • KeepByAgeLifecycleRule object
  • KeepByVersionLifecycleRule object
  • DeleteLifecycleRule object
  • DeleteByVersionCondition object
  • DockerFilters object
  • MavenFilters object
  1. Concepts
  2. Lifecycle policy

Lifecycle policy in Yandex Cloud Registry

Written by
Sergey Kanunnikov
Updated at March 5, 2026
  • Types of rules
    • KEEP
    • HARD_DELETE
    • SOFT_DELETE
  • Rule filters
  • Applying policies
  • Rule object (LifecycleRule)
    • KeepByAgeLifecycleRule object
    • KeepByVersionLifecycleRule object
    • DeleteLifecycleRule object
    • DeleteByVersionCondition object
    • DockerFilters object
    • MavenFilters object

A lifecycle policy consists of rules that manage storage or deletion of artifacts in a registry. Policies automate the cleanup of old or unused artifact versions to save space and reduce storage costs.

Rules are specified as a JSON array of rule objects when creating a lifecycle policy.

Each policy rule includes a filter by path_prefix. It indicates which artifacts the rule applies to.

Examples

Prefix Apply the rule to
.* All artifacts in the registry
ubuntu/.* Artifacts whose paths start with ubuntu/

Warning

Rules apply to packages. If you set a rule saying Keep only the ten most recent versions with path_prefix = .* for a registry containing two packages, e.g., ubuntu and vault, the rule will apply separately to each package. As a result, the ten latest versions will be retained in each package, rather than across all packages.

The number of lifecycle policies and rules within them are subject to quotas and limits.

Types of rulesTypes of rules

Lifecycle policy rules:

  • Apply only to artifacts matching the filter.
  • Determine which of these artifacts to retain or delete.

KEEPKEEP

Rules of the KEEP type describe which artifacts the lifecycle policy should retain. These rules have higher priority than deletion rules (HARD_DELETE and SOFT_DELETE).

The retention conditions include:

  • Age: Keeps artifacts younger than the specified age in days.
  • Number of versions: Keeps the specified number of the latest artifact versions, e.g., the five most recently created versions.

HARD_DELETEHARD_DELETE

A rule of the HARD_DELETE type permanently deletes artifacts matching the rule conditions. After the rule applies, the artifacts are permanently deleted, and you cannot restore them.

The deletion conditions include:

  • Age: Deletes artifacts older than the specified age in days.
  • Number of versions: Deletes the oldest artifacts if they exceed the specified number (the oldest versions are deleted).
  • Always: Deletes all artifacts.

SOFT_DELETESOFT_DELETE

A rule of the SOFT_DELETE type marks artifacts for deletion but does not delete them immediately. The artifacts remain in the registry during the cooldown period specified in the rule. After this period ends, the artifacts are permanently deleted.

Note

Artifacts marked for soft deletion remain billable until the end of the cooldown period.

The SOFT_DELETE and HARD_DELETE rule conditions are the same.

Rule filtersRule filters

Each rule includes filters indicating which artifacts the rule applies to:

  • Path prefix (path_prefix): Determines which artifacts the rule applies to based on their path. If you specify .*, the rule will apply to all artifacts of all packages in the registry. You can provide a specific path prefix, e.g., @path/prefix.*.
  • Docker filters: Additional filters for Docker images by tag status (with tags, no tags).
  • Maven filters: Additional filters for Java artifacts by version type (release versions, snapshots).

Rules based on the number of versions or date apply to artifacts matching all the specified filters.

Applying policiesApplying policies

Lifecycle policies apply automatically according to a schedule. Rules are processed daily at the specified time. Policy changes are not immediate and take effect with the next processing cycle.

Rules apply in the following priority order:

  1. KEEP rules: Determine which artifacts to retain.
  2. HARD_DELETE and SOFT_DELETE rules: Determine which artifacts to delete, ignoring those protected by the KEEP rules.

Rule object (LifecycleRule)Rule object (LifecycleRule)

The keep_by_age, keep_by_version, and delete fields are mutually exclusive; you can only specify one action per rule.

Field Type Description
path_prefix string Path prefix indicating which artifacts the rule applies to. If it is not specified, the rule will apply to all artifacts.
keep_by_age KeepByAgeLifecycleRule Keeping artifacts based on their age.
keep_by_version KeepByVersionLifecycleRule Keeping artifacts based on the number of versions.
delete DeleteLifecycleRule Deleting artifacts.
docker_filters DockerFilters Filters for rules applied to Docker images.
maven_filters MavenFilters Filters for rules applied to Java artifacts.
version_regexp string Regular expression to search for a package version or Docker image tag.

KeepByAgeLifecycleRule objectKeepByAgeLifecycleRule object

Field Type Description
younger_than_days integer Keep artifacts younger than the specified number of days.

KeepByVersionLifecycleRule objectKeepByVersionLifecycleRule object

Field Type Description
keep_versions_count integer Keep the specified number of artifact versions.

DeleteLifecycleRule objectDeleteLifecycleRule object

The older_than_days, version_condition, and always fields are mutually exclusive; you can only specify one deletion condition.

Field Type Description
type string Deletion type:
  • HARD_DELETE: Permanently delete artifacts.
  • SOFT_DELETE: Mark artifacts for deletion with an option to restore.
cooldown_period_days integer Waiting period before deletion, in days.
older_than_days integer Delete artifacts older than the specified number of days.
version_condition DeleteByVersionCondition Delete artifacts based on the number of versions.
always boolean Delete all matching artifacts.

DeleteByVersionCondition objectDeleteByVersionCondition object

Field Type Description
versions_count_greater_than integer Delete artifacts if their versions exceed the specified number.

DockerFilters objectDockerFilters object

Field Type Description
tag_status string Filter Docker images by tag status:
  • TAG_STATUS_ANY: Any status.
  • TAGGED: Only Docker images with a tag.
  • UNTAGGED: Only Docker images with no tags.

    MavenFilters objectMavenFilters object

    Field Type Description
    version_type string Filter Java artifacts by version type:
    • VERSION_TYPE_ANY: Any type
    • RELEASE: Only release versions
    • SNAPSHOT: Only snapshots

    See alsoSee also

    • Creating a lifecycle policy
    • Configuring lifecycle policies
    • Creating a registry

    Was the article helpful?

    Previous
    Binary artifact
    Next
    Quotas and limits
    © 2026 Direct Cursus Technology L.L.C.