ALIYUN::ECD::Desktops类型用于创建一台或多台云桌面。

语法

{
  "Type": "ALIYUN::ECD::Desktops",
  "Properties": {
    "UserAssignMode": String,
    "PromotionId": String,
    "PolicyGroupId": String,
    "UserName": String,
    "AutoRenew": Boolean,
    "Amount": Integer,
    "DesktopName": String,
    "Hostname": String,
    "Period": Integer,
    "VolumeEncryptionEnabled": Boolean,
    "AutoPay": Boolean,
    "GroupId": String,
    "OfficeSiteId": String,
    "DesktopNameSuffix": Boolean,
    "BundleId": String,
    "EndUserId": List,
    "VpcId": String,
    "ChargeType": String,
    "VolumeEncryptionKey": String,
    "Tags": List,
    "PeriodUnit": String,
    "DirectoryId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
UserAssignMode String 云桌面分配模式。 取值:
  • ALL(默认值):如果您设置了EndUserId参数,创建的云桌面会分配给每个指定的用户。
  • PER_USER:如果您设置了EndUserId参数,则创建的云桌面会平均分配给指定的用户。

    您需确保Amount参数的取值可以被EndUserId参数中EndUserId的个数取值整除。

说明 如果您未设置EndUserId参数,则创建的云桌面不会分配给用户。
PromotionId String 优惠活动ID。
PolicyGroupId String 策略ID。
AutoRenew Boolean 是否自动续费。 取值:
  • true:自动续费。续费时长与购买设置的时长保持一致。
  • false(默认值):不自动续费。
说明 当参数ChargeType取值为PrePaid时,此参数才生效。
Amount Integer 创建的云桌面数量。 取值范围:1~300。

默认值:1。

DesktopName String 云桌面名称。
Hostname String 自定义设置云桌面的主机名称。 仅支持设置AD工作区下,操作系统类型是Windows的云桌面。
当您创建一台云桌面时,主机名称的命名规则如下:
  • 长度为2~15个字符。
  • 支持大小写字母、数字或者短划线(-)。不能以短划线开头或者结尾,不能连续使用短划线(-),不能只使用数字。

当您创建多台云桌面时,命名规则为name_prefix[begin_number,bits]name_suffix,例如:当设置Hostname的取值为ecd-[1,4]-test时,第一台云桌面主机名称为ecd-0001-test,第二台云桌面主机名称为ecd-0002-test,依次类推。

多台云桌面统一命名格式说明如下:
  • name_prefix:主机名称的前缀。
  • begin_number,bits:主机名称中的有序数字。
  • name_suffix:主机名称的后缀。
Period Integer 购买资源的时长。 单位由PeriodUnit指定。当参数ChargeType取值为PrePaid时才生效,且为必选值。
  • 如果PeriodUnitMonth,取值范围:1、2、3、6。
  • 如果PeriodUnitYear,取值范围:1、2、3、4、5。
VolumeEncryptionEnabled Boolean 是否开启磁盘加密。 取值:
  • true:开启磁盘加密。
  • false(默认值):未开启磁盘加密。
AutoPay Boolean 是否自动支付。
取值:
  • true(默认值):自动支付。

    请您确保账号余额充足,否则会产生异常订单。

  • false:只产生订单,不支付。
GroupId String 桌面组ID。
OfficeSiteId String 工作区ID。
DesktopNameSuffix Boolean 桌面名称是否自动增加后缀。 取值:
  • true:自动增加后缀。
  • false(默认值):不增加后缀。
BundleId String 桌面模板ID。
EndUserId List 授权使用云桌面的用户ID。 即将桌面分配给用户。可设置1~100个。
  • 在同一时段内,只有一个用户可以使用该桌面。
  • 如果未设置该参数,则创建的云桌面不会分配给任何用户。
ChargeType String 云桌面的计费方式。
取值:
  • PostPaid(默认值):按量付费。
  • PrePaid:包年包月。
VolumeEncryptionKey String 开启磁盘加密的情况下使用的KMS的密钥ID。 关于如何获取KMS的密钥ID,请参见ListKeys
Tags List 标签。 请参见Tags属性
PeriodUnit String 包年包月计费方式的时长单位。 取值:
  • Month(默认值):月。
  • Year:年。
VpcId String 此参数暂不开放使用。
DirectoryId String 此参数暂不开放使用。
UserName String 此参数暂不开放使用。

Tags语法

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

Tags属性

属性名称 类型 必须 允许更新 描述 约束
Value String 标签值。 可设置1~20个。
Key String 标签键。 可设置1~20个。

返回值

Fn::GetAtt

  • DesktopId:云桌面ID。
  • OrderId:订单ID。

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "PolicyGroupId": {
          "Type": "String",
          "Description": "The ID of the policy."
        },
        "OfficeSiteId": {
          "Type": "String",
          "Description": "The ID of the workspace."
        },
        "BundleId": {
          "Type": "String",
          "Description": "The ID of the cloud desktop template."
        }
      },
      "Resources": {
        "Desktops": {
          "Type": "ALIYUN::ECD::Desktops",
          "Properties": {
            "PolicyGroupId": {
              "Ref": "PolicyGroupId"
            },
            "OfficeSiteId": {
              "Ref": "OfficeSiteId"
            },
            "BundleId": {
              "Ref": "BundleId"
            }
          }
        }
      },
      "Outputs": {
        "DesktopId": {
          "Description": "The ID of the cloud desktop. If multiple cloud desktops are created in a call, the\nIDs of the cloud desktops are returned.",
          "Value": {
            "Fn::GetAtt": [
              "Desktops",
              "DesktopId"
            ]
          }
        },
        "OrderId": {
          "Description": "The ID of the order.\nNote This parameter is returned only when the ChargeType parameter is set to PrePaid.",
          "Value": {
            "Fn::GetAtt": [
              "Desktops",
              "OrderId"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      PolicyGroupId:
        Type: String
        Description: The ID of the policy.
      OfficeSiteId:
        Type: String
        Description: The ID of the workspace.
      BundleId:
        Type: String
        Description: The ID of the cloud desktop template.
    Resources:
      Desktops:
        Type: ALIYUN::ECD::Desktops
        Properties:
          PolicyGroupId:
            Ref: PolicyGroupId
          OfficeSiteId:
            Ref: OfficeSiteId
          BundleId:
            Ref: BundleId
    Outputs:
      DesktopId:
        Description: |-
          The ID of the cloud desktop. If multiple cloud desktops are created in a call, the
          IDs of the cloud desktops are returned.
        Value:
          Fn::GetAtt:
            - Desktops
            - DesktopId
      OrderId:
        Description: |-
          The ID of the order.
          Note This parameter is returned only when the ChargeType parameter is set to PrePaid.
        Value:
          Fn::GetAtt:
            - Desktops
            - OrderId