All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::Snapshot

Last Updated:Sep 06, 2023

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,
    "RetentionDays": Integer
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DiskId

String

Yes

No

The ID of the disk for which you want to create the snapshot.

None.

SnapshotName

String

No

No

The snapshot name.

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://.

The snapshot name cannot start with auto because auto is the prefix of auto snapshot names.

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 size.

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. It cannot start with http:// or https://.

By default, this property is empty.

ResourceGroupId

String

No

Yes

The ID of the resource group to which the snapshot belongs.

None.

Tags

List

No

Yes

The tags.

You can add up to 20 tags.

For more information, see Tags properties.

InstantAccess

Boolean

No

No

Specifies whether to enable the instant access feature for the snapshot.

Valid values:

  • true: enables the instant access feature. You can enable this feature only for enhanced SSDs (ESSDs).

  • false (default): disables the instant access feature. If InstantAccess is set to false, a normal snapshot is created.

InstantAccessRetentionDays

Integer

No

No

The retention period of the instant access feature. After the retention period ends, the snapshot is automatically released.

This property takes effect only when InstantAccess is set to true.

Valid values: 1 to 65535.

Unit: day.

RetentionDays

Integer

No

No

The retention period of the snapshot.

Unit: day. After the retention period ends, the snapshot is automatically released.

Valid values: 1 to 65536.

By default, this property is empty. When this property is empty, the snapshot cannot be automatically released.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The key of the tag.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The value of the tag.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values

Fn::GetAtt

SnapshotId: the snapshot ID.

Examples

  • YAML format

    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
  • JSON format

    {
      "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.