Up-to-date reference of API arguments for CBR vault you can get at documentation portal
opentelekomcloud_cbr_vault_v3¶
Manages a V3 CBR Vault resource within OpenTelekomCloud.
Example usage¶
Simple vault¶
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
billing {
size = 100
object_type = "disk"
protect_type = "backup"
charging_mode = "post_paid"
}
}
Vault with associated resource (server)¶
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
billing {
size = 100
object_type = "disk"
protect_type = "backup"
charging_mode = "post_paid"
}
resource {
id = opentelekomcloud_ecs_instance_v1.instance.id
type = "OS::Nova::Server"
exclude_volumes = [
opentelekomcloud_ecs_instance_v1.instance_1.data_disks.1.id
]
}
}
Include volumes works currently only on SwissCloud:
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
billing {
size = 100
object_type = "disk"
protect_type = "backup"
charging_mode = "post_paid"
}
resource {
id = opentelekomcloud_ecs_instance_v1.instance.id
type = "OS::Nova::Server"
include_volumes = [
opentelekomcloud_ecs_instance_v1.instance_1.data_disks.1.id
]
}
}
Vault with associated resource (volume)¶
resource "opentelekomcloud_blockstorage_volume_v2" "volume" {
name = "cbr-test-volume"
size = 10
volume_type = "SSD"
}
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
locked = false
billing {
size = 100
object_type = "disk"
protect_type = "backup"
charging_mode = "post_paid"
}
resource {
id = opentelekomcloud_blockstorage_volume_v2.volume.id
type = "OS::Cinder::Volume"
}
}
Vault with associated resource (sfs-turbo)¶
variable "vpc_id" {}
variable "subnet_id" {}
variable "sg_id" {}
variable "az" {}
resource "opentelekomcloud_sfs_turbo_share_v1" "sfs-turbo" {
name = "sfs-turbo-share"
size = 500
share_proto = "NFS"
vpc_id = var.vpc_id
subnet_id = var.subnet_id
security_group_id = var.sg_id
availability_zone = var.az
}
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
billing {
size = 1000
object_type = "turbo"
protect_type = "backup"
charging_mode = "post_paid"
}
resource {
id = opentelekomcloud_sfs_turbo_share_v1.sfs-turbo.id
type = "OS::Sfs::Turbo"
}
}
Vault with associated policy¶
resource "opentelekomcloud_cbr_policy_v3" "policy" {
name = "some-policy"
operation_type = "backup"
trigger_pattern = [
"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00"
]
operation_definition {
day_backups = 1
week_backups = 2
year_backups = 3
month_backups = 4
max_backups = 10
timezone = "UTC+03:00"
}
enabled = "false"
}
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for terraform provider test"
backup_policy_id = opentelekomcloud_cbr_policy_v3.policy.id
billing {
size = 100
object_type = "disk"
protect_type = "backup"
charging_mode = "post_paid"
}
}
Vault with backup and replication policies¶
resource "opentelekomcloud_cbr_vault_v3" "policies" {
name = "multipolicy"
billing {
size = 100
object_type = "server"
protect_type = "backup"
charging_mode = "post_paid"
period_type = "month"
period_num = 2
}
policy {
id = opentelekomcloud_cbr_policy_v3.backup[1].id
}
policy {
id = var.replication_policy_id
destination_vault_id = var.destination_vault
}
}
Vault with auto bind and bind rule¶
resource "opentelekomcloud_cbr_vault_v3" "vault" {
name = "cbr-vault-test"
description = "CBR vault for default backup policy"
billing {
size = 10
object_type = "server"
protect_type = "backup"
charging_mode = "post_paid"
}
auto_bind = true
bind_rules {
key = "foo"
value = "bar"
}
}
Argument reference¶
The following arguments are supported:
name- Vault name.billing- Billing parameter information for creation. Billing fields:cloud_type- (Optional) Cloud platform. One ofpublic(default),hybridconsistent_level- (Optional) Backup specifications. The default value iscrash_consistentobject_type- Object type. One ofserver,disk,turbo.protect_type- Operation type. One ofbackup,replicationsize- Capacity, in GB. Minimum1, maximum10485760charging_mode- Billing mode. Possible value ispost_paid(pay-per-use).is_auto_renew- (Optional) Whether to automatically renew the subscription after expiration. By default, it is not renewed.is_auto_pay- (Optional) Whether the fee is automatically deducted from the customer's account balance after an order is submitted. The non-automatic payment mode is used by default.console_url- (Optional) Redirection URL.extra_info- (Optional) Map of extra info.
resource- (Optional) Associated resources. Multiple. Resource fields:id- ID of the resource to be backed up.type- Type of the resource to be backed up. Possible values areOS::Nova::Server,OS::Cinder::VolumeandOS::Sfs::Turbo.name- (Optional) Resource name.exclude_volumes- (Optional) List of excluded volumes.include_volumes- (Optional) List of included volumes.
backup_policy_id- (Optional) Backup policy ID. If the value of this parameter is empty, automatic backup is not performed. Deprecated usepolicyinstead.description- (Optional) User-defined vault description.tags- (Optional) Tag map.auto_bind- (Optional) Whether automatic association is supported.bind_rules- (Optional) Tag map, a rules for automatic association. You can only select tag keys and values from the existing ones. If there are no tags available, go to the corresponding service to create one. You can add a maximum of 5 tags for a search. If more than one tag is added, the backups containing one of the specified tags will be returned.auto_expand- (Optional) Whether to automatically expand the vault capacity. Only pay-per-use vaults support this function.locked- (Optional) Specifies whether the vault is locked. A locked vault cannot be unlocked. Defaults to false.policy- (Optional, List) Specifies the policy details to associate with the CBR vault. The object structure is documented below.
id- (Required, String) Specifies the policy ID.destination_vault_id- (Optional, String) Specifies the ID of destination vault to which the replication policy will be associated.
-> Only one policy of each type (backup and replication) can be associated.
Attributes Reference¶
All above argument parameters can be exported as attribute parameters along with attribute reference.
product_id- Product ID.order_id- Order ID.allocated- Allocated capacity, in MB.spec_code- Specification code.used- Used capacity, in MB.storage_unit- Name of the bucket for the vault.frozen_scene- Scenario when an account is frozen.status- Vault status.
Import¶
Volumes can be imported using the id, e.g.
terraform import opentelekomcloud_cbr_vault_v3.vault ea257959-eeb1-4c10-8d33-26f0409a766b