ALIYUN::ECS::AutoSnapshotPolicy is used to create an automatic snapshot policy.

Syntax

{
  "Type" : "ALIYUN::ECS::AutoSnapshotPolicy",
  "Properties" : {
    "TimePoints" : String,
    "RepeatWeekdays" : String,
    "RetentionDays" : Integer,
    "DiskIds" : String,
    "AutoSnapshotPolicyName" : String
  }
}

Properties

Name Type Required Editable Description Validity
TimePoints List Yes Yes The points in time when automatic snapshots are created. Unit: hours.

Valid values: 0 to 23. The values indicate a total of 24 hours from 00:00 to 23:00. For example, 1 indicates 01:00. To schedule multiple automatic snapshot creation tasks in a day, you can set the TimePoints parameter to an array.

  • You can specify up to 24 points in time.
  • You must specify the parameter in a JSON-formatted array such as [0, 1, ... 23]. Separate multiple points in time with commas (,).
RepeatWeekdays List Yes Yes The days of a week on which automatic snapshots are created.

Valid values: 1 to 7. For example, 1 indicates Monday. To schedule multiple automatic snapshot creation tasks in a week, you can set the RepeatWeekdays parameter to an array.

  • You can specify up to seven days over a one-week period.
  • You must specify the parameter in a JSON-formatted array such as [1, 2, ... 7]. Separate multiple days with commas (,).
RetentionDays Integer Yes Yes The retention period of the automatic snapshot. Unit: days.

Valid values:

  • -1: The automatic snapshot is permanently retained.
  • 1-65536: The automatic snapshot is retained for the specified number of days.

Default value: -1.

DiskIds List Yes Yes

The IDs of the disks.

To apply the automatic snapshot policy to multiple disks, set the value of this parameter to a JSON-formatted array: ["d-xxxxxxxxx", "d-yyyyyyyyy", ... "d-zzzzzzzzz"]. Separate multiple IDs with commas (,).

None
AutoSnapshotPolicyName String No Yes The name of the automatic snapshot policy.
  • The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-).
  • It must start with a letter and cannot start with http:// or https://.

This parameter is empty by default.

Response parameters

Fn::GetAtt

AutoSnapshotPolicyId: the ID of the automatic snapshot policy.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "AutoSnapshotPolicy": {
      "Type": "ALIYUN::ECS::AutoSnapshotPolicy",
      "Properties": {
        "TimePoints": ["0"],
        "RepeatWeekdays": ["1"],
        "RetentionDays": 10,
        "DiskIds": ["<DiskId>"],
        "AutoSnapshotPolicyName": "MyAutoSnapshotPolicy"
      }
    }
  }
}