Deleting a lifecycle policy
Warning
Starting October 13, 2026, Yandex Container Registry will be unavailable to new users.
The existing users can create resources until November 10, 2026. Afterwards, Yandex Container Registry will go read-only and cease to operate on December 14, 2026. For more information on how it will be handled, see this article on Yandex Container Registry sunset.
- In the management console
, select the folder with the registry. - Navigate
to Container Registry. - Select the registry and click the row with its name.
- Select the repository and click the row with its name.
- In the left-hand panel, click
Lifecycle. - Click
for the policy in question and select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
-
Delete the policy by specifying its ID:
yc container repository lifecycle-policy delete <policy_ID>To find out the policy ID, get a list of lifecycle policies in the repository or registry.
-
Make sure the policy has been deleted:
yc container repository lifecycle-policy list --repository-name crp2hlbs67tj********/ubuntuResult:
+----+------+---------------+--------+---------+-------------+ | ID | NAME | REPOSITORY ID | STATUS | CREATED | DESCRIPTION | +----+------+---------------+--------+---------+-------------+ +----+------+---------------+--------+---------+-------------+
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
-
Open the configuration file and delete the section describing the policy:
Example of a policy description in the Terraform configuration
resource "yandex_container_repository_lifecycle_policy" "my_lifecycle_policy" { name = "best-policy" status = "active" repository_id = "crpfvi6o4ra7********" rule { description = "rule for applying policy" untagged = true tag_regexp = ".*" retained_top = 1 expire_period = "48h" } } -
Apply the changes:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
This will delete the lifecycle policy from the specified repository. You can check that the policy has been deleted using the management console
yc container repository lifecycle-policy list --registry-id <registry_ID>
To delete a policy, use the Delete method for the LifecyclePolicyService resource. Specify the policy ID in the lifecycle_policy_id parameter.
You can get the list of policies using the List method for the LifecyclePolicyService resource.