Provides a EBS Enterprise Snapshot Policy resource. enterprise snapshot policy.
For information about EBS Enterprise Snapshot Policy and how to use it, see What is Enterprise Snapshot Policy.
Basic Usage
variable "name" {
default = "terraform-example"
}
provider "alicloud" {
region = "cn-hangzhou"
}
resource "alicloud_ecs_disk" "defaultJkW46o" {
category = "cloud_essd"
description = "esp-attachment-test"
zone_id = "cn-hangzhou-i"
performance_level = "PL1"
size = "20"
disk_name = var.name
}
resource "alicloud_ebs_enterprise_snapshot_policy" "defaultPE3jjR" {
status = "DISABLED"
desc = "DESC"
schedule {
cron_expression = "0 0 0 1 * ?"
}
enterprise_snapshot_policy_name = var.name
target_type = "DISK"
retain_rule {
time_interval = "120"
time_unit = "DAYS"
}
}
The following arguments are supported:
cross_region_copy_info
- (Optional) Snapshot replication information. See cross_region_copy_info
below.desc
- (Optional) Description information representing the resource.enterprise_snapshot_policy_name
- (Required) The name of the resource.resource_group_id
- (Optional, Computed) The ID of the resource group.retain_rule
- (Required) Snapshot retention policy representing resources. See retain_rule
below.schedule
- (Required) The scheduling plan that represents the resource. See schedule
below.special_retain_rules
- (Optional, ForceNew) Snapshot special retention rules. See special_retain_rules
below.status
- (Optional, Computed) The status of the resource.storage_rule
- (Optional) Snapshot storage policy. See storage_rule
below.tags
- (Optional, Map) The tag of the resource.target_type
- (Required, ForceNew) Represents the target type of resource binding.cross_region_copy_info
The cross_region_copy_info supports the following:
enabled
- (Optional) Enable Snapshot replication.regions
- (Optional) Destination region for Snapshot replication. See regions
below.cross_region_copy_info-regions
The cross_region_copy_info-regions supports the following:
region_id
- (Optional) Destination region ID.retain_days
- (Optional) Number of days of snapshot retention for replication.retain_rule
The retain_rule supports the following:
number
- (Optional) Retention based on counting method.time_interval
- (Optional) Time unit.time_unit
- (Optional) Time-based retention.schedule
The schedule supports the following:
cron_expression
- (Required) CronTab expression.special_retain_rules
The special_retain_rules supports the following:
enabled
- (Optional) Whether special reservations are enabled. Value range:
rules
- (Optional) List of special retention rules. See rules
below.special_retain_rules-rules
The special_retain_rules-rules supports the following:
special_period_unit
- (Optional) The cycle unit of the special reserved snapshot. If the value is set to WEEKS, the first snapshot of each week is reserved. The retention time is determined by TimeUnit and TimeInterval. The value range is:
time_interval
- (Optional) Retention time value. The value range is greater than 1.time_unit
- (Optional) The retention time unit for a particular snapshot. Value range:
storage_rule
The storage_rule supports the following:
enable_immediate_access
- (Optional) Snapshot speed available.The following attributes are exported:
id
- The ID of the resource supplied above.create_time
- The creation time of the resource.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Enterprise Snapshot Policy.delete
- (Defaults to 5 mins) Used when delete the Enterprise Snapshot Policy.update
- (Defaults to 5 mins) Used when update the Enterprise Snapshot Policy.EBS Enterprise Snapshot Policy can be imported using the id, e.g.
$ terraform import alicloud_ebs_enterprise_snapshot_policy.example <id>