ALIYUN::GWS::Cluster类型用于创建集群。

语法

{
  "Type": "ALIYUN::GWS::Cluster",
  "Properties": {
    "Policy": Map,
    "VpcId": String,
    "VSwitchId": String,
    "ClusterType": String,
    "Name": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
Policy Map 集群策略 详情请参见Policy属性
VpcId String 专有网络ID
VSwitchId String 交换机ID
ClusterType String 集群类型 取值:gws.s1.standard
Name String 集群名称

Policy语法

"Policy": {
  "LocalDrive": String,
  "UsbRedirect": String,
  "Clipboard": String,
  "Watermark": String
}

Policy属性

属性名称 类型 必须 允许更新 描述 约束
LocalDrive String 本地文件操作 取值:
  • off
  • read
  • readwrite
UsbRedirect String USB重定向 取值:
  • on
  • off
Clipboard String 剪贴板 取值:
  • off
  • read
  • readwrite
Watermark String 水印 取值:
  • on
  • off

返回值

Fn::GetAtt

  • ClusterId:集群ID。
  • Name:集群名称。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Policy": {
      "Type": "Json",
      "Description": "Cluster policy"
    },
    "VpcId": {
      "Type": "String",
      "Description": "VPC id"
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "VSwitch id"
    },
    "ClusterType": {
      "Type": "String",
      "Description": "Cluster Type:\ngws.s1.standard"
    },
    "Name": {
      "Type": "String",
      "Description": "Cluster name"
    }
  },
  "Resources": {
    "Cluster": {
      "Type": "ALIYUN::GWS::Cluster",
      "Properties": {
        "Policy": {
          "Ref": "Policy"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "ClusterType": {
          "Ref": "ClusterType"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "Cluster id",
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "ClusterId"
        ]
      }
    },
    "Name": {
      "Description": "Cluster name",
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "Name"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Policy:
    Type: Json
    Description: Cluster policy
  VpcId:
    Type: String
    Description: VPC id
  VSwitchId:
    Type: String
    Description: VSwitch id
  ClusterType:
    Type: String
    Description: |-
      Cluster Type:
      gws.s1.standard
  Name:
    Type: String
    Description: Cluster name
Resources:
  Cluster:
    Type: 'ALIYUN::GWS::Cluster'
    Properties:
      Policy:
        Ref: Policy
      VpcId:
        Ref: VpcId
      VSwitchId:
        Ref: VSwitchId
      ClusterType:
        Ref: ClusterType
      Name:
        Ref: Name
Outputs:
  ClusterId:
    Description: Cluster id
    Value:
      'Fn::GetAtt':
        - Cluster
        - ClusterId
  Name:
    Description: Cluster name
    Value:
      'Fn::GetAtt':
        - Cluster
        - Name