ALIYUN::ECS::Snapshot is used to create a snapshot for a disk.

Syntax

{
  "Type": "ALIYUN::ECS::Snapshot",
  "Properties": {
    "SnapshotName": String,
    "Timeout": Integer,
    "Description": String,
    "DiskId": String,
    "Tags": List,
    "InstantAccess": Boolean,
    "InstantAccessRetentionDays": Integer,
    "ResourceGroupId": String
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
DiskId String Yes No The ID of the disk for which you want to create the snapshot. None
SnapshotName String No No The name of the snapshot. The name must be 2 to 128 characters in length, and can contain letters, digits, colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http://, https:// or auto.

The name cannot start with auto because the names of automatic snapshots start with auto.

Timeout Integer No No The timeout period within which you can create the snapshot. If you specify this property, the timeout period within which you can create a stack is extended. If the snapshot is not created within the specified timeout period, the stack fails to be created. You can specify this property based on the disk size and the data volume.

Valid values: 200 to 1440.

Default value: 200.

Unit: minutes.

Description String No No The description of the snapshot. The description must be 2 to 256 characters in length. The description cannot start with http:// or https://.

By default, this property is empty.

ResourceGroupIdStringNoYesThe ID of the resource group to which the snapshot belongs. None
TagsListNoYesThe tags of the snapshot. You can add up to 20 tags.

For more information, see Tags properties.

InstantAccessBooleanNoNoSpecifies whether to enable the instant access feature for the snapshot. Default value: false. Valid values:
  • true: enables the instant access feature. You can enable this feature only for enhanced SSDs (ESSDs).
  • false: disables the instant access feature. In this case, regular snapshots are created.
InstantAccessRetentionDaysIntegerNoNoThe validity period of the instant access feature that you want to enable for the snapshot. After the retention period ends, the snapshot is automatically released. This property takes effect only when the InstantAccess property is set to true.

Valid values: 1 to 65535.

Unit: days.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe key of the tag. The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.
ValueStringNoNoThe value of the tag. The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

Return values

Fn::GetAtt

SnapshotId: the ID of the snapshot.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DiskId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Disk::DiskId
    Resources:
      Snapshot:
        Type: ALIYUN::ECS::Snapshot
        Properties:
          Timeout: 300
          DiskId:
            Ref: DiskId
    Outputs:
      SnapshotId:
        Description: The snapshot ID.
        Value:
          Fn::GetAtt:
            - Snapshot
            - SnapshotId
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DiskId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Disk::DiskId"
        }
      },
      "Resources": {
        "Snapshot": {
          "Type": "ALIYUN::ECS::Snapshot",
          "Properties": {
            "Timeout": 300,
            "DiskId": {
              "Ref": "DiskId"
            }
          }
        }
      },
      "Outputs": {
        "SnapshotId": {
          "Description": "The snapshot ID.",
          "Value": {
            "Fn::GetAtt": [
              "Snapshot",
              "SnapshotId"
            ]
          }
        }
      }
    }

For more examples, visit DiskAttachment.json and DiskAttachment.yml. In the examples, the ALIYUN::ECS::DiskAttachment and ALIYUN::ECS::Snapshot resource types are used.