Provides a ECS Auto Snapshot Policy resource.
For information about ECS Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy.
Basic Usage
resource "alicloud_ecs_auto_snapshot_policy" "example" {
name = "tf-testAcc"
repeat_weekdays = ["1", "2", "3"]
retention_days = -1
time_points = ["1", "22", "23"]
}
The following arguments are supported:
name
- (Optional) The snapshot policy name.repeat_weekdays
- (Required) The automatic snapshot repetition dates. The unit of measurement is day and the repeating cycle is a week. Value range: [1, 7], which represents days starting from Monday to Sunday, for example 1 indicates Monday. When you want to schedule multiple automatic snapshot tasks for a disk in a week, you can set the RepeatWeekdays to an array.
retention_days
- (Required) The snapshot retention time, and the unit of measurement is day. Optional values:
time_points
- (Required) The automatic snapshot creation schedule, and the unit of measurement is hour. Value range: [0, 23], which represents from 00:00 to 24:00, for example 1 indicates 01:00. When you want to schedule multiple automatic snapshot tasks for a disk in a day, you can set the TimePoints to an array.
target_copy_regions
- (Optional) The destination region to which the snapshot is copied. You can set a destination region.copied_snapshots_retention_days
- (Optional) The retention period of the snapshot copied across regions.
enable_cross_region_copy
- (Optional) Specifies whether to enable the system to automatically copy snapshots across regions.tags
- (Optional) A mapping of tags to assign to the resource.The following attributes are exported:
id
- The resource ID in terraform of Auto Snapshot Policy.status
- The status of Auto Snapshot Policy.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 2 mins) Used when create the Auto Snapshot Policy.delete
- (Defaults to 3 mins) Used when delete the Auto Snapshot Policy.ECS Auto Snapshot Policy can be imported using the id, e.g.
$ terraform import alicloud_ecs_auto_snapshot_policy.example <id>