ALIYUN::GWS::Instance类型用于创建实例。

语法

{
  "Type": "ALIYUN::GWS::Instance",
  "Properties": {
    "ClusterId": String,
    "SystemDiskSize": Integer,
    "InstanceChargeType": String,
    "AutoRenew": Boolean,
    "VSwitchId": String,
    "Period": Integer,
    "AllocatePublicAddress": Boolean,
    "SystemDiskCategory": String,
    "Name": String,
    "InternetChargeType": String,
    "InternetMaxBandwidthOut": Integer,
    "InternetMaxBandwidthIn": Integer,
    "ImageId": String,
    "InstanceType": String,
    "AppList": List,
    "WorkMode": String,
    "PeriodUnit": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ClusterId String 集群ID。
SystemDiskSize Integer 系统盘大小。
InstanceChargeType String 实例付费方式。 取值:
  • PostPaid(默认值):按量付费。
  • PrePaid:包年包月。
AutoRenew Boolean 自动续费。 取值:
  • true
  • false(默认值)
VSwitchId String 交换机ID。
Period Integer 付费周期。 InstanceChargeType取值为PostPaid(包年包月)时该参数生效。
  • PeriodUnit为Week(周)时,取值范围:1~4。
  • PeriodUnit为 Month(月)时,取值:1、2、3、4、5、6、7、8、9、12、24、36、48 、60。
AllocatePublicAddress Boolean 是否分配公网地址。 取值:
  • true
  • false
SystemDiskCategory String 系统盘的种类。 取值:
  • cloud_ssd
  • cloud_essd
Name String 实例名称。
InternetChargeType String 网络计费方式。 AllocatePublicAddress取值为true时该参数生效。取值:
  • PayByTraffic(默认值):按使用流量计费。
  • PayByBandwidth:按固定带宽计费。
InternetMaxBandwidthOut Integer 公网出带宽最大值。 AllocatePublicAddress取值为true时该参数生效。

取值范围:1~200。

单位:Mbps。

InternetMaxBandwidthIn Integer 公网入带宽最大值。 AllocatePublicAddress取值为true时该参数生效。

取值范围:1~200。

单位:Mbps。

默认值:200。
ImageId String 镜像ID。
InstanceType String 实例规格。
AppList List 应用列表。 WorkMode取值为Application时该参数生效。

最多支持添加10个应用。

详情请参见AppList属性

WorkMode String 工作模式。 取值:
  • Desktop
  • Application
PeriodUnit String 包年包月的单位。

InstanceChargeType取值为PostPaid(包年包月)时该参数生效。

取值:
  • Week
  • Month

AppList语法

"AppList": [
  {
    "AppArgs": String,
    "AppPath": String,
    "AppName": String
  }
]

AppList属性

属性名称 类型 必须 允许更新 描述 约束
AppArgs String 应用的运行参数。
AppPath String 应用的运行路径。
AppName String 应用名称。

返回值

Fn::GetAtt

  • MaxBandwidthOut:公网出带宽最大值。
  • MaxBandwidthIn:公网入带宽最大值。
  • InstanceId:实例ID。
  • ClusterId:集群ID。
  • InstanceChargeType:付费类型。
  • Name:实例名称。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "Cluster id"
    },
    "SystemDiskSize": {
      "Type": "Number",
      "Description": "System disk size"
    },
    "InstanceChargeType": {
      "Type": "String",
      "Description": "Instance charge type:\nPostPaid (default): Pay-As-You-Go\nPrePaid: Subscription",
      "AllowedValues": [
        "PostPaid",
        "PrePaid"
      ]
    },
    "AutoRenew": {
      "Type": "Boolean",
      "Description": "Whether auto renew",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "VSwitch id"
    },
    "Period": {
      "Type": "Number",
      "Description": "Period of subscription.\nWhen PeriodUnit is Week, the value range is 1-4\nWhen PeriodUnit is Month, the value range is 1-9, 12, 24, 36, 48, 60\nThis value is only valid when InstanceChargeType is PrePaid."
    },
    "AllocatePublicAddress": {
      "Type": "Boolean",
      "Description": "Whether to allocate a public network address",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "SystemDiskCategory": {
      "Type": "String",
      "Description": "System disk categories: cloud_ssd, cloud_essd, cloud, cloud and so on."
    },
    "Name": {
      "Type": "String",
      "Description": "Instance name"
    },
    "InternetChargeType": {
      "Type": "String",
      "Description": "Network charge type:\nPayByTraffic (default): Flow-per-use billing\nPayByBandwidth: fixed-bandwidth billing\nThis value is only valid when AllocatePublicAddress is true.",
      "AllowedValues": [
        "PayByTraffic",
        "PayByBandwidth"
      ]
    },
    "InternetMaxBandwidthOut": {
      "Type": "Number",
      "Description": "Maximum outbound bandwidth of the public network (in Mbps).\nValue range: 1-200\nDefault: 200\nThis value is only valid when AllocatePublicAddress is true."
    },
    "InternetMaxBandwidthIn": {
      "Type": "Number",
      "Description": "Maximum inbound bandwidth of the public network (in Mbps).\nValue range: 1-200\nDefault: 200\nThis value is only valid when AllocatePublicAddress is true."
    },
    "ImageId": {
      "Type": "String",
      "Description": "Mirror id"
    },
    "InstanceType": {
      "Type": "String",
      "Description": "Examples of specifications, see examples of racial or specifications call DescribeInstanceTypes get specification sheet."
    },
    "AppList": {
      "Type": "Json",
      "Description": "App list. This value is only valid when WorkMode is Application.",
      "MaxLength": 10
    },
    "WorkMode": {
      "Type": "String",
      "Description": "Work mode:\nDesktop\nApplication",
      "AllowedValues": [
        "Desktop",
        "Application"
      ]
    },
    "PeriodUnit": {
      "Type": "String",
      "Description": "Unit of period. Week or Month.\nThis value is only valid when InstanceChargeType is PrePaid.",
      "AllowedValues": [
        "Week",
        "Month"
      ]
    }
  },
  "Resources": {
    "Instance": {
      "Type": "ALIYUN::GWS::Instance",
      "Properties": {
        "ClusterId": {
          "Ref": "ClusterId"
        },
        "SystemDiskSize": {
          "Ref": "SystemDiskSize"
        },
        "InstanceChargeType": {
          "Ref": "InstanceChargeType"
        },
        "AutoRenew": {
          "Ref": "AutoRenew"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "Period": {
          "Ref": "Period"
        },
        "AllocatePublicAddress": {
          "Ref": "AllocatePublicAddress"
        },
        "SystemDiskCategory": {
          "Ref": "SystemDiskCategory"
        },
        "Name": {
          "Ref": "Name"
        },
        "InternetChargeType": {
          "Ref": "InternetChargeType"
        },
        "InternetMaxBandwidthOut": {
          "Ref": "InternetMaxBandwidthOut"
        },
        "InternetMaxBandwidthIn": {
          "Ref": "InternetMaxBandwidthIn"
        },
        "ImageId": {
          "Ref": "ImageId"
        },
        "InstanceType": {
          "Ref": "InstanceType"
        },
        "AppList": {
          "Ref": "AppList"
        },
        "WorkMode": {
          "Ref": "WorkMode"
        },
        "PeriodUnit": {
          "Ref": "PeriodUnit"
        }
      }
    }
  },
  "Outputs": {
    "MaxBandwidthOut": {
      "Description": "Maximum outbound bandwidth of the public network (in Mbps)",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "MaxBandwidthOut"
        ]
      }
    },
    "MaxBandwidthIn": {
      "Description": "Maximum inbound bandwidth of the public network (in Mbps)",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "MaxBandwidthIn"
        ]
      }
    },
    "InstanceId": {
      "Description": "Instance id",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "InstanceId"
        ]
      }
    },
    "ClusterId": {
      "Description": "Cluster id",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "ClusterId"
        ]
      }
    },
    "InstanceChargeType": {
      "Description": "Instance charge type",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "InstanceChargeType"
        ]
      }
    },
    "Name": {
      "Description": "Instance name",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Name"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterId:
    Type: String
    Description: Cluster id
  SystemDiskSize:
    Type: Number
    Description: System disk size
  InstanceChargeType:
    Type: String
    Description: |-
      Instance charge type:
      PostPaid (default): Pay-As-You-Go
      PrePaid: Subscription
    AllowedValues:
      - PostPaid
      - PrePaid
  AutoRenew:
    Type: Boolean
    Description: Whether auto renew
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  VSwitchId:
    Type: String
    Description: VSwitch id
  Period:
    Type: Number
    Description: |-
      Period of subscription.
      When PeriodUnit is Week, the value range is 1-4
      When PeriodUnit is Month, the value range is 1-9, 12, 24, 36, 48, 60
      This value is only valid when InstanceChargeType is PrePaid.
  AllocatePublicAddress:
    Type: Boolean
    Description: Whether to allocate a public network address
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  SystemDiskCategory:
    Type: String
    Description: 'System disk categories: cloud_ssd, cloud_essd, cloud, cloud and so on.'
  Name:
    Type: String
    Description: Instance name
  InternetChargeType:
    Type: String
    Description: |-
      Network charge type:
      PayByTraffic (default): Flow-per-use billing
      PayByBandwidth: fixed-bandwidth billing
      This value is only valid when AllocatePublicAddress is true.
    AllowedValues:
      - PayByTraffic
      - PayByBandwidth
  InternetMaxBandwidthOut:
    Type: Number
    Description: |-
      Maximum outbound bandwidth of the public network (in Mbps).
      Value range: 1-200
      Default: 200
      This value is only valid when AllocatePublicAddress is true.
  InternetMaxBandwidthIn:
    Type: Number
    Description: |-
      Maximum inbound bandwidth of the public network (in Mbps).
      Value range: 1-200
      Default: 200
      This value is only valid when AllocatePublicAddress is true.
  ImageId:
    Type: String
    Description: Mirror id
  InstanceType:
    Type: String
    Description: >-
      Examples of specifications, see examples of racial or specifications call
      DescribeInstanceTypes get specification sheet.
  AppList:
    Type: Json
    Description: App list. This value is only valid when WorkMode is Application.
    MaxLength: 10
  WorkMode:
    Type: String
    Description: |-
      Work mode:
      Desktop
      Application
    AllowedValues:
      - Desktop
      - Application
  PeriodUnit:
    Type: String
    Description: |-
      Unit of period. Week or Month.
      This value is only valid when InstanceChargeType is PrePaid.
    AllowedValues:
      - Week
      - Month
Resources:
  Instance:
    Type: 'ALIYUN::GWS::Instance'
    Properties:
      ClusterId:
        Ref: ClusterId
      SystemDiskSize:
        Ref: SystemDiskSize
      InstanceChargeType:
        Ref: InstanceChargeType
      AutoRenew:
        Ref: AutoRenew
      VSwitchId:
        Ref: VSwitchId
      Period:
        Ref: Period
      AllocatePublicAddress:
        Ref: AllocatePublicAddress
      SystemDiskCategory:
        Ref: SystemDiskCategory
      Name:
        Ref: Name
      InternetChargeType:
        Ref: InternetChargeType
      InternetMaxBandwidthOut:
        Ref: InternetMaxBandwidthOut
      InternetMaxBandwidthIn:
        Ref: InternetMaxBandwidthIn
      ImageId:
        Ref: ImageId
      InstanceType:
        Ref: InstanceType
      AppList:
        Ref: AppList
      WorkMode:
        Ref: WorkMode
      PeriodUnit:
        Ref: PeriodUnit
Outputs:
  MaxBandwidthOut:
    Description: Maximum outbound bandwidth of the public network (in Mbps)
    Value:
      'Fn::GetAtt':
        - Instance
        - MaxBandwidthOut
  MaxBandwidthIn:
    Description: Maximum inbound bandwidth of the public network (in Mbps)
    Value:
      'Fn::GetAtt':
        - Instance
        - MaxBandwidthIn
  InstanceId:
    Description: Instance id
    Value:
      'Fn::GetAtt':
        - Instance
        - InstanceId
  ClusterId:
    Description: Cluster id
    Value:
      'Fn::GetAtt':
        - Instance
        - ClusterId
  InstanceChargeType:
    Description: Instance charge type
    Value:
      'Fn::GetAtt':
        - Instance
        - InstanceChargeType
  Name:
    Description: Instance name
    Value:
      'Fn::GetAtt':
        - Instance
        - Name