ALIYUN::ENS::Snapshot

ALIYUN::ENS::Snapshot类型用于创建快照。

语法

{
  "Type": "ALIYUN::ENS::Snapshot",
  "Properties": {
    "Description": String,
    "EnsRegionId": String,
    "SnapshotName": String,
    "DiskId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Description

String

快照的描述。

长度为2~256个英文或中文字符,不能以http://https://开头。

EnsRegionId

String

ENS节点ID。

SnapshotName

String

快照的显示名称。

长度为2~128个英文或中文字符。必须以大小字母或中文开头,不能以http://https://开头。可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。

DiskId

String

云盘ID。

返回值

Fn::GetAtt

SnapShotId:快照ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Description:
        AssociationProperty: TextArea
        Description:
          en: 'The description of the snapshot. The description must be 2 to 256 characters
            in length and cannot start with http:// or https://.
    
            By default, this parameter is left empty.'
        Required: false
        Type: String
      DiskId:
        Description:
          en: The ID of the cloud disk.
        Required: true
        Type: String
      EnsRegionId:
        Description:
          en: The ID of the edge node.
        Required: true
        Type: String
      SnapshotName:
        Description:
          en: The name of the snapshot. The name must be 2 to 128 characters in length.
            It must start with a letter and cannot start with http:// or https://. It
            can contain letters, digits, colons (:), underscores (_), and hyphens (-).
        Required: false
        Type: String
    Resources:
      Snapshot:
        Properties:
          Description:
            Ref: Description
          DiskId:
            Ref: DiskId
          EnsRegionId:
            Ref: EnsRegionId
          SnapshotName:
            Ref: SnapshotName
        Type: ALIYUN::ENS::Snapshot
    Outputs:
      SnapShotId:
        Description: The ID of the snapshot.
        Value:
          Fn::GetAtt:
          - Snapshot
          - SnapShotId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description of the snapshot. The description must be 2 to 256 characters in length and cannot start with http:// or https://.\nBy default, this parameter is left empty."
          },
          "Required": false
        },
        "EnsRegionId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the edge node."
          },
          "Required": true
        },
        "SnapshotName": {
          "Type": "String",
          "Description": {
            "en": "The name of the snapshot. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
          },
          "Required": false
        },
        "DiskId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the cloud disk."
          },
          "Required": true
        }
      },
      "Resources": {
        "Snapshot": {
          "Type": "ALIYUN::ENS::Snapshot",
          "Properties": {
            "Description": {
              "Ref": "Description"
            },
            "EnsRegionId": {
              "Ref": "EnsRegionId"
            },
            "SnapshotName": {
              "Ref": "SnapshotName"
            },
            "DiskId": {
              "Ref": "DiskId"
            }
          }
        }
      },
      "Outputs": {
        "SnapShotId": {
          "Description": "The ID of the snapshot.",
          "Value": {
            "Fn::GetAtt": [
              "Snapshot",
              "SnapShotId"
            ]
          }
        }
      }
    }