全部产品
Search
文档中心

资源编排:ALIYUN::ENS::Disk

更新时间:Mar 26, 2024

ALIYUN::ENS::Disk类型用于创建一块按量付费或包年包月数据盘。

语法

{
  "Type": "ALIYUN::ENS::Disk",
  "Properties": {
    "SnapshotId": String,
    "Category": String,
    "KMSKeyId": String,
    "Encrypted": Boolean,
    "InstanceChargeType": String,
    "Size": String,
    "DiskName": String,
    "EnsRegionId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

SnapshotId

String

创建云盘使用的快照。

SnapshotId参数和Size参数存在以下限制:

  • 如果SnapshotId参数对应的快照容量大于设置的Size参数值,实际创建的云盘大小为指定快照的大小。

  • 如果SnapshotId参数对应的快照容量小于设置的Size参数值,实际创建的云盘大小为指定的Size参数值。

Category

String

磁盘种类。

取值:

  • 高效云盘:cloud_efficiency

  • 全闪云盘:cloud_ssd

KMSKeyId

String

云盘使用的KMS密钥ID。

如果Encrypted置为trueKMSKeyId为空时则使用服务默认密钥。

Encrypted

Boolean

是否加密云盘。

取值:

  • true:加密云盘。

  • false(默认值):不加密云盘。

InstanceChargeType

String

实例付费方式。

当前仅支持PostPaid(按量付费)。

Size

String

磁盘大小。

单位:GiB。

DiskName

String

磁盘名称。

EnsRegionId

String

节点ID。

返回值

Fn::GetAtt

DiskId:实例ID

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Category:
        Description:
          en: 'The category of the disk. Valid values:
    
            cloud_efficiency: ultra disk.
    
            cloud_ssd: all-flash disk.'
        Required: true
        Type: String
      DiskName:
        Description:
          en: The name of the disk.
        Required: false
        Type: String
      Encrypted:
        Description:
          en: 'Specifies whether to encrypt the new system disk. Valid values:
    
            true
    
            false (default): no'
        Required: false
        Type: Boolean
      EnsRegionId:
        Description:
          en: The ID of the edge node.
        Required: true
        Type: String
      InstanceChargeType:
        AssociationPropertyMetadata:
          LocaleKey: InstanceChargeType
        Default: PostPaid
        Description:
          en: The billing method of the instance. Set the value to PostPaid.
        Required: true
        Type: String
      KMSKeyId:
        Description:
          en: 'The ID of the Key Management Service (KMS) key that is used by the cloud
            disk.
    
            Note If you set the Encrypted parameter to true, the default service key is
            used when the KMSKeyId parameter is empty.'
        Required: false
        Type: String
      Size:
        Description:
          en: 'The size of the disk. Unit: GiB.'
        Required: true
        Type: String
      SnapshotId:
        Description:
          en: 'The ID of the snapshot that you want to use to create the disk.
    
            The following limits apply to the SnapshotId and Size parameters:
    
            If the size of the snapshot specified by SnapshotId is greater than the specified
            Size value, the size of the created disk is equal to the specified snapshot
            size.
    
            If the size of the snapshot specified by SnapshotId is smaller than the specified
            Size value, the size of the created disk is equal to the specified Size value.'
        Required: false
        Type: String
    Resources:
      Disk:
        Properties:
          Category:
            Ref: Category
          DiskName:
            Ref: DiskName
          Encrypted:
            Ref: Encrypted
          EnsRegionId:
            Ref: EnsRegionId
          InstanceChargeType:
            Ref: InstanceChargeType
          KMSKeyId:
            Ref: KMSKeyId
          Size:
            Ref: Size
          SnapshotId:
            Ref: SnapshotId
        Type: ALIYUN::ENS::Disk
    Outputs:
      DiskId:
        Description: The ID of the instance.
        Value:
          Fn::GetAtt:
          - Disk
          - DiskId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "SnapshotId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the snapshot that you want to use to create the disk.\nThe following limits apply to the SnapshotId and Size parameters:\nIf the size of the snapshot specified by SnapshotId is greater than the specified Size value, the size of the created disk is equal to the specified snapshot size.\nIf the size of the snapshot specified by SnapshotId is smaller than the specified Size value, the size of the created disk is equal to the specified Size value."
          },
          "Required": false
        },
        "Category": {
          "Type": "String",
          "Description": {
            "en": "The category of the disk. Valid values:\ncloud_efficiency: ultra disk.\ncloud_ssd: all-flash disk."
          },
          "Required": true
        },
        "KMSKeyId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the Key Management Service (KMS) key that is used by the cloud disk.\nNote If you set the Encrypted parameter to true, the default service key is used when the KMSKeyId parameter is empty."
          },
          "Required": false
        },
        "Encrypted": {
          "Type": "Boolean",
          "Description": {
            "en": "Specifies whether to encrypt the new system disk. Valid values:\ntrue\nfalse (default): no"
          },
          "Required": false
        },
        "InstanceChargeType": {
          "AssociationPropertyMetadata": {
            "LocaleKey": "InstanceChargeType"
          },
          "Type": "String",
          "Description": {
            "en": "The billing method of the instance. Set the value to PostPaid."
          },
          "Required": true,
          "Default": "PostPaid"
        },
        "Size": {
          "Type": "String",
          "Description": {
            "en": "The size of the disk. Unit: GiB."
          },
          "Required": true
        },
        "DiskName": {
          "Type": "String",
          "Description": {
            "en": "The name of the disk."
          },
          "Required": false
        },
        "EnsRegionId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the edge node."
          },
          "Required": true
        }
      },
      "Resources": {
        "Disk": {
          "Type": "ALIYUN::ENS::Disk",
          "Properties": {
            "SnapshotId": {
              "Ref": "SnapshotId"
            },
            "Category": {
              "Ref": "Category"
            },
            "KMSKeyId": {
              "Ref": "KMSKeyId"
            },
            "Encrypted": {
              "Ref": "Encrypted"
            },
            "InstanceChargeType": {
              "Ref": "InstanceChargeType"
            },
            "Size": {
              "Ref": "Size"
            },
            "DiskName": {
              "Ref": "DiskName"
            },
            "EnsRegionId": {
              "Ref": "EnsRegionId"
            }
          }
        }
      },
      "Outputs": {
        "DiskId": {
          "Description": "The ID of the instance.",
          "Value": {
            "Fn::GetAtt": [
              "Disk",
              "DiskId"
            ]
          }
        }
      }
    }