全部产品
Search
文档中心

资源编排:ALIYUN::CDDC::MyBase

更新时间:Jun 21, 2024

ALIYUN::CDDC::MyBase类型用于创建专有版主机。

语法

{
  "Type": "ALIYUN::CDDC::MyBase",
  "Properties": {
    "EcsInstanceName": String,
    "PeriodType": String,
    "ResourceGroupId": String,
    "UserData": String,
    "DedicatedHostGroupDescription": String,
    "DedicatedHostGroupId": String,
    "AutoRenew": Boolean,
    "EcsUniqueSuffix": Boolean,
    "ImageId": String,
    "UserDataInBase64": Boolean,
    "EcsHostName": String,
    "Engine": String,
    "PasswordInherit": Boolean,
    "KeyPairName": String,
    "ZoneId": String,
    "VSwitchId": String,
    "SecurityGroupId": String,
    "ECSClassList": List,
    "Period": Integer,
    "PayType": String,
    "InternetChargeType": String,
    "EcsDeploymentSetId": String,
    "InternetMaxBandwidthOut": Integer,
    "VpcId": String,
    "OsPassword": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ECSClassList

List

ECS规格信息。

示例值:

[{"sysDiskCapacity":40,"instanceType":"ecs.d2s.10xlarge","nodeCount":1,"sysDiskType":"cloud_essd"}]

Engine

String

数据库类型。

取值:

  • AliSQL

  • Tair

PayType

String

付费类型。

目前仅支持PrePaid

Period

Integer

购买时长。

SecurityGroupId

String

安全组ID。

VpcId

String

专有网络VPC ID。

VSwitchId

String

虚拟交换机ID。

ZoneId

String

可用区ID。

AutoRenew

Boolean

是否开启自动续费。

取值:

  • true:开启。

  • false(默认值):关闭。

DedicatedHostGroupDescription

String

专属集群的名称。

DedicatedHostGroupId

String

已有专有版专属集群ID。

EcsDeploymentSetId

String

云服务器部署集ID。

EcsHostName

String

主机名。

  • Windows系统:长度为2~15个字符,允许使用大小写字母、数字。不能仅使用数字。

  • 其他操作系统(Linux等):长度为2~64个字符,允许使用点号(.)分隔字符成多段,每段允许使用大小写字母、数字,但不能连续使用点号(.)。不能以点号(.)开头或结尾。

EcsInstanceName

String

ECS实例名称。

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

默认值:InstanceId。

EcsUniqueSuffix

Boolean

当创建多台实例时,是否为HostName和InstanceName自动添加有序后缀。

有序后缀从001开始递增,最大不能超过999。

取值:

  • true:添加。

  • false(默认值):不添加。

当HostName或InstanceName按照指定排序格式设置,未设置命名后缀name_suffix,即命名格式为name_prefix[begin_number,bits]时,EcsUniqueSuffix不生效,名称仅按照指定顺序排序。

ImageId

String

自定义镜像ID。

若您需要使用默认镜像,无需填写。

InternetChargeType

String

网络计费类型。

取值:

  • PayByBandwidth:按固定带宽计费。

  • PayByTraffic:按使用流量计费。

InternetMaxBandwidthOut

Integer

公网出带宽最大值。

单位为Mbit/s。

取值范围:0~100。

默认值:0。设定为大于0时会自动创建公网IP。

KeyPairName

String

密钥对名称。

OsPassword

String

主机登录密码。

密码须符合如下要求:

  • 长度为8~30个字符。

  • 必须至少包含三项:大写字母、小写字母、数字和特殊字符。

  • 特殊符号()\~!@#$%^&*-_+=|{}[]:;'<>,.?/`

说明

如果需要稍后设置主机登录密码,此参数填写空字符串即可。

  • 如果需要设置主机登录密码,建议您使用HTTPS协议发送请求,避免密码泄露。

PasswordInherit

Boolean

是否使用镜像的默认密码。

取值:

  • true:使用镜像的默认密码。

  • false(默认值):不使用镜像的默认密码。

说明

若使用镜像的默认密码,OSPassword参数无需填写。

PeriodType

String

预付费类型。

目前仅支持Monthly(包月)。

ResourceGroupId

String

资源组ID。

UserData

String

用户自定义脚本数据。

原始数据最多为16KB。

UserDataInBase64

Boolean

自定义数据是否采用Base64格式编码。

取值:

  • true:采用Base64格式编码。

  • false:不采用Base64格式编码。

返回值

Fn::GetAtt

  • OrderIds:订单ID列表。

  • InstanceIds:已创建成功的ECS主机ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AutoRenew:
    Description:
      en: Whether to enable auto renew.
    Required: false
    Type: Boolean
  DedicatedHostGroupDescription:
    Description:
      en: The name of the dedicated cluster.
    Required: false
    Type: String
  DedicatedHostGroupId:
    Description:
      en: The ID of the dedicated cluster.
    Required: false
    Type: String
  ECSClassList:
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Description:
          en: ECS Class Properties.
        Required: true
        Type: Json
    Description:
      en: ECS Class List.
    MaxLength: 1
    MinLength: 1
    Required: true
    Type: Json
  EcsDeploymentSetId:
    Description:
      en: The ID of the deployment set.
    Required: false
    Type: String
  EcsHostName:
    Description:
      en: The host name of the ECS instance.
    Required: false
    Type: String
  EcsInstanceName:
    Description:
      en: The name of the ECS instance.
    Required: false
    Type: String
  EcsUniqueSuffix:
    Description:
      en: The unique suffix of the ECS instance.
    Required: false
    Type: Boolean
  Engine:
    Description:
      en: Database type.
    Required: true
    Type: String
  ImageId:
    Description:
      en: The image ID.
    Required: false
    Type: String
  InternetChargeType:
    AllowedValues:
    - PayByTraffic
    - PayByBandwidth
    AssociationPropertyMetadata:
      LocaleKey: InternetChargeType
    Description:
      en: "Network billing type. Value range: \nPayByBandwidth: billed based on fixed\
        \ bandwidth. \nPayByTraffic: Pay by traffic usage."
    Required: false
    Type: String
  InternetMaxBandwidthOut:
    Description:
      en: "Set internet output bandwidth of instance. Unit is Mbps(Mega bit per second).\
        \ \nRange is [0,200]. Default is 1. \nWhile the property is not 0, public\
        \ ip will be assigned for instance."
    MinValue: 0
    Required: false
    Type: Number
  KeyPairName:
    Description:
      en: The name of the key pair.
    Required: false
    Type: String
  OsPassword:
    Description:
      en: Password of created ecs instance. Must contain at least 3 types of special
        character, lower character, upper character, number.
    Required: false
    Type: String
  PasswordInherit:
    Description:
      en: Whether to inherit the password from the parent cluster.
    Required: false
    Type: Boolean
  PayType:
    AllowedValues:
    - Subscription
    Description:
      en: Payment type, currently only supports PrePaid.
    Required: true
    Type: String
  Period:
    AssociationProperty: PayPeriod
    Description:
      en: The period of the subscription in months.
    MaxValue: 12
    MinValue: 1
    Required: true
    Type: Number
  PeriodType:
    AssociationProperty: PayPeriodUnit
    Description:
      en: Prepaid type, currently only supports Monthly (monthly subscription).
    Required: false
    Type: String
  ResourceGroupId:
    Description:
      en: Resource group id.
    Required: false
    Type: String
  SecurityGroupId:
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
    Description:
      en: The ID of the security group.
    Required: true
    Type: String
  UserData:
    AssociationProperty: TextArea
    Description:
      en: User-defined script data, the original data is up to 16KB.
    Required: false
    Type: String
  UserDataInBase64:
    Description:
      en: The user data of the ECS instance.
    Required: false
    Type: Boolean
  VSwitchId:
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
    Description:
      en: Virtual switch ID.
    Required: true
    Type: String
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Description:
      en: The ID of the VPC.
    Required: true
    Type: String
  ZoneId:
    AssociationProperty: ZoneId
    Description:
      en: Availability Zone ID.
    Required: true
    Type: String
Resources:
  MyBase:
    Properties:
      AutoRenew:
        Ref: AutoRenew
      DedicatedHostGroupDescription:
        Ref: DedicatedHostGroupDescription
      DedicatedHostGroupId:
        Ref: DedicatedHostGroupId
      ECSClassList:
        Ref: ECSClassList
      EcsDeploymentSetId:
        Ref: EcsDeploymentSetId
      EcsHostName:
        Ref: EcsHostName
      EcsInstanceName:
        Ref: EcsInstanceName
      EcsUniqueSuffix:
        Ref: EcsUniqueSuffix
      Engine:
        Ref: Engine
      ImageId:
        Ref: ImageId
      InternetChargeType:
        Ref: InternetChargeType
      InternetMaxBandwidthOut:
        Ref: InternetMaxBandwidthOut
      KeyPairName:
        Ref: KeyPairName
      OsPassword:
        Ref: OsPassword
      PasswordInherit:
        Ref: PasswordInherit
      PayType:
        Ref: PayType
      Period:
        Ref: Period
      PeriodType:
        Ref: PeriodType
      ResourceGroupId:
        Ref: ResourceGroupId
      SecurityGroupId:
        Ref: SecurityGroupId
      UserData:
        Ref: UserData
      UserDataInBase64:
        Ref: UserDataInBase64
      VSwitchId:
        Ref: VSwitchId
      VpcId:
        Ref: VpcId
      ZoneId:
        Ref: ZoneId
    Type: ALIYUN::CDDC::MyBase
Outputs:
  InstanceIds:
    Description: The instance id list of created ecs instances
    Value:
      Fn::GetAtt:
      - MyBase
      - InstanceIds
  OrderIds:
    Description: The order id list.
    Value:
      Fn::GetAtt:
      - MyBase
      - OrderIds
                        

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EcsInstanceName": {
      "Type": "String",
      "Description": {
        "en": "The name of the ECS instance."
      },
      "Required": false
    },
    "PeriodType": {
      "AssociationProperty": "PayPeriodUnit",
      "Type": "String",
      "Description": {
        "en": "Prepaid type, currently only supports Monthly (monthly subscription)."
      },
      "Required": false
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": {
        "en": "Resource group id."
      },
      "Required": false
    },
    "UserData": {
      "AssociationProperty": "TextArea",
      "Type": "String",
      "Description": {
        "en": "User-defined script data, the original data is up to 16KB."
      },
      "Required": false
    },
    "DedicatedHostGroupDescription": {
      "Type": "String",
      "Description": {
        "en": "The name of the dedicated cluster."
      },
      "Required": false
    },
    "DedicatedHostGroupId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the dedicated cluster."
      },
      "Required": false
    },
    "AutoRenew": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether to enable auto renew."
      },
      "Required": false
    },
    "EcsUniqueSuffix": {
      "Type": "Boolean",
      "Description": {
        "en": "The unique suffix of the ECS instance."
      },
      "Required": false
    },
    "ImageId": {
      "Type": "String",
      "Description": {
        "en": "The image ID."
      },
      "Required": false
    },
    "UserDataInBase64": {
      "Type": "Boolean",
      "Description": {
        "en": "The user data of the ECS instance."
      },
      "Required": false
    },
    "EcsHostName": {
      "Type": "String",
      "Description": {
        "en": "The host name of the ECS instance."
      },
      "Required": false
    },
    "Engine": {
      "Type": "String",
      "Description": {
        "en": "Database type."
      },
      "Required": true
    },
    "PasswordInherit": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether to inherit the password from the parent cluster."
      },
      "Required": false
    },
    "KeyPairName": {
      "Type": "String",
      "Description": {
        "en": "The name of the key pair."
      },
      "Required": false
    },
    "ZoneId": {
      "AssociationProperty": "ZoneId",
      "Type": "String",
      "Description": {
        "en": "Availability Zone ID."
      },
      "Required": true
    },
    "VSwitchId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "en": "Virtual switch ID."
      },
      "Required": true
    },
    "SecurityGroupId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "Type": "String",
      "Description": {
        "en": "The ID of the security group."
      },
      "Required": true
    },
    "ECSClassList": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "Json",
          "Description": {
            "en": "ECS Class Properties."
          },
          "Required": true
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "ECS Class List."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 1
    },
    "Period": {
      "AssociationProperty": "PayPeriod",
      "Type": "Number",
      "Description": {
        "en": "The period of the subscription in months."
      },
      "Required": true,
      "MinValue": 1,
      "MaxValue": 12
    },
    "PayType": {
      "Type": "String",
      "Description": {
        "en": "Payment type, currently only supports PrePaid."
      },
      "AllowedValues": [
        "Subscription"
      ],
      "Required": true
    },
    "InternetChargeType": {
      "AssociationPropertyMetadata": {
        "LocaleKey": "InternetChargeType"
      },
      "Type": "String",
      "Description": {
        "en": "Network billing type. Value range: \nPayByBandwidth: billed based on fixed bandwidth. \nPayByTraffic: Pay by traffic usage."
      },
      "AllowedValues": [
        "PayByTraffic",
        "PayByBandwidth"
      ],
      "Required": false
    },
    "EcsDeploymentSetId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the deployment set."
      },
      "Required": false
    },
    "InternetMaxBandwidthOut": {
      "Type": "Number",
      "Description": {
        "en": "Set internet output bandwidth of instance. Unit is Mbps(Mega bit per second). \nRange is [0,200]. Default is 1. \nWhile the property is not 0, public ip will be assigned for instance."
      },
      "Required": false,
      "MinValue": 0
    },
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC."
      },
      "Required": true
    },
    "OsPassword": {
      "Type": "String",
      "Description": {
        "en": "Password of created ecs instance. Must contain at least 3 types of special character, lower character, upper character, number."
      },
      "Required": false
    }
  },
  "Resources": {
    "MyBase": {
      "Type": "ALIYUN::CDDC::MyBase",
      "Properties": {
        "EcsInstanceName": {
          "Ref": "EcsInstanceName"
        },
        "PeriodType": {
          "Ref": "PeriodType"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "UserData": {
          "Ref": "UserData"
        },
        "DedicatedHostGroupDescription": {
          "Ref": "DedicatedHostGroupDescription"
        },
        "DedicatedHostGroupId": {
          "Ref": "DedicatedHostGroupId"
        },
        "AutoRenew": {
          "Ref": "AutoRenew"
        },
        "EcsUniqueSuffix": {
          "Ref": "EcsUniqueSuffix"
        },
        "ImageId": {
          "Ref": "ImageId"
        },
        "UserDataInBase64": {
          "Ref": "UserDataInBase64"
        },
        "EcsHostName": {
          "Ref": "EcsHostName"
        },
        "Engine": {
          "Ref": "Engine"
        },
        "PasswordInherit": {
          "Ref": "PasswordInherit"
        },
        "KeyPairName": {
          "Ref": "KeyPairName"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "ECSClassList": {
          "Ref": "ECSClassList"
        },
        "Period": {
          "Ref": "Period"
        },
        "PayType": {
          "Ref": "PayType"
        },
        "InternetChargeType": {
          "Ref": "InternetChargeType"
        },
        "EcsDeploymentSetId": {
          "Ref": "EcsDeploymentSetId"
        },
        "InternetMaxBandwidthOut": {
          "Ref": "InternetMaxBandwidthOut"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "OsPassword": {
          "Ref": "OsPassword"
        }
      }
    }
  },
  "Outputs": {
    "OrderIds": {
      "Description": "The order id list.",
      "Value": {
        "Fn::GetAtt": [
          "MyBase",
          "OrderIds"
        ]
      }
    },
    "InstanceIds": {
      "Description": "The instance id list of created ecs instances",
      "Value": {
        "Fn::GetAtt": [
          "MyBase",
          "InstanceIds"
        ]
      }
    }
  }
}