Deleting a backup policy
- In the management console
, select the folder you want to delete a backup policy from. - From the list of services, select Cloud Backup.
- Navigate to the
Backup policies tab. - Click
next to the backup policy you want to delete and select Delete. - Confirm the backup policy deletion.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command to delete a backup policy:
yc backup policy delete --help
-
Get the ID of the backup policy you want to delete:
yc backup policy list
Result:
+----------------------+----------------------+---------+---------+---------------------+---------------------+ | ID | FOLDER ID | NAME | ENABLED | CREATED AT | UPDATED AT | +----------------------+----------------------+---------+---------+---------------------+---------------------+ | abc7n3wln123******** | ghi681qpe789******** | policy1 | true | 2023-07-03 09:12:02 | 2023-07-03 09:12:43 | | deflqbiwc456******** | ghi681qpe789******** | policy2 | true | 2023-07-07 14:58:23 | 2023-07-07 14:58:23 | +----------------------+----------------------+---------+---------+---------------------+---------------------+
-
Delete the backup policy by specifying its ID:
yc backup policy delete <backup_policy_ID>
For more information about the command, see the CLI reference.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
To delete a backup policy created with Terraform:
-
Open the Terraform configuration file and delete the fragment with the
yandex_backup_policy
resource description:Below is an example with the description of the
yandex_backup_policy
resource in the Terraform configurationresource "yandex_backup_policy" "my_policy" { archive_name = "[<VM_or_BareMetal_server_name>]-[<plan_ID>]-[<unique_ID>]" cbt = "USE_IF_ENABLED" compression = "NORMAL" fast_backup_enabled = true format = "AUTO" multi_volume_snapshotting_enabled = true name = "<backup_policy_name>" performance_window_enabled = true silent_mode_enabled = true splitting_bytes = "9223372036854775807" vss_provider = "NATIVE" reattempts { enabled = true interval = "1m" max_attempts = 10 } retention { after_backup = false rules { max_age = "365d" repeat_period = [] } } scheduling { enabled = false max_parallel_backups = 0 random_max_delay = "30m" scheme = "ALWAYS_INCREMENTAL" weekly_backup_day = "MONDAY" backup_sets { execute_by_time { type = "MONTHLY" include_last_day_of_month = true monthdays = [] months = [1,2,3,4,5,6,7,8,9,10,11,12] repeat_at = ["04:10"] repeat_every = "30m" weekdays = [] } } } vm_snapshot_reattempts { enabled = true interval = "1m" max_attempts = 10 } }
For more information about
yandex_backup_policy
properties, see this Terraform article . -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
You will see a detailed list of resources. No changes will be made at this step. Terraform will show any errors found in your configuration.
-
Apply the changes:
terraform apply
-
Type
yes
and press Enter to confirm the changes.
You can check updates in the management console
or using this CLI command:yc backup policy list
-
To delete a backup policy, use the delete REST API method for the Policy resource or the PolicyService/Delete gRPC API call.