Deleting a backup policy
- In the management console
, select the folder you want to delete a backup policy from. - In the list of services, select Cloud Backup.
- Go 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 command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder 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 don't have Terraform, install it and configure the 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 preserve_file_security_settings = true quiesce_snapshotting_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" execute_by_time { 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" type = "MONTHLY" weekdays = [] } } vm_snapshot_reattempts { enabled = true interval = "1m" max_attempts = 10 } }
For more information about the
yandex_backup_policy
resource parameters, see the provider documentation . -
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
You can check the update using the management console
or 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.