ALIYUN::VPC::EIPAssociation用於為雲產品執行個體綁定Elastic IP Address(EIP)。
文法
{
"Type": "ALIYUN::VPC::EIPAssociation",
"Properties": {
"AllocationId": String,
"InstanceId": String,
"PrivateIpAddress": String,
"Mode": String
}
} 屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
AllocationId | String | 是 | 是 | Elastic IP Address的ID。 | 無 |
InstanceId | String | 是 | 是 | 雲產品執行個體的ID。 | 支援以下雲產品執行個體類型:
|
PrivateIpAddress | String | 否 | 是 | 交換器網段內的一個私網IP地址。 | 如果不指定該參數,系統將根據VPC ID和交換器ID自動分配一個私網IP地址。 |
Mode | String | 否 | 是 | 繫結模式。 | 取值:
|
傳回值
Fn::GetAtt
EipAddress:Elastic IP Address的地址。
AllocationId:Elastic IP Address的ID。
樣本
情境 1 :建立單個ECS,並綁定EIP。
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create a VPC type ECS and bind EIP (existing VPC).
zh-cn: 建立VPC類型ECS,並綁定EIP(已有VPC)。
Parameters:
VPC:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Type: String
Description:
en: Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud.
zh-cn: 現有專用網路的執行個體ID,在專用網路控制台選擇專用網路進行查詢。
Label:
en: VPC ID
zh-cn: Virtual Private Cloud執行個體ID
VSwitch:
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
Type: String
Description:
en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch.</font>
zh-cn: 現有交換器ID,在專用網路控制台選擇交換器進行查詢,<font color='red'>交換器必須在VPC下。ECS將建立在此交換器下。</font>
Label:
en: VSwitch ID
zh-cn: 交換器執行個體ID
SecurityGroup:
Type: String
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
Description:
en: Please search the business security group ID starting with (sg-xxx) from console-ECS-Network & Security.
zh-cn: 現有業務安全性群組的執行個體ID,在ECS控制台選擇安全性群組進行查詢。<br><font color='red'>安全性群組必須歸屬在VPC下。</font>
Label:
en: Business Security Group ID
zh-cn: 業務安全性群組ID
AssociationPropertyMetadata:
VpcId: ${VPC}
ECSInstanceType:
AssociationPropertyMetadata:
InstanceChargeType: ${ECSInstanceType}
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
Type: String
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1、選擇機型前請先確認當前可用性區域下該機型是否有貨,部分機型需要提前報備。</b></font><br><font color='blue'><b>2、取值:</font><br></b></font>[ecs.c5.large:<font color='green'>2vCPU 4 GiB,內網頻寬1Gbps、內網收發包30萬PPS。</font>]<br></b>[ecs.c5.xlarge:<font color='green'>4vCPU 8GiB,內網頻寬1.5Gbps、內網收發包50萬PPS。</font>]<br></b>[ecs.c5.2xlarge: <font color='green'>8vCPU 16 GiB,內網頻寬2.5 Gbps、內網收發包80萬PPS。</font>]
Label:
en: Instance Type
zh-cn: 執行個體規格
ECSDiskCategory:
Type: String
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>取值:</b></font><br>[cloud_efficiency: <font color=''green''>高效雲端硬碟</font>]<br>[cloud_ssd: <font color=''green''>SSD雲端硬碟</font>]<br>[cloud_essd: <font color=''green''>ESSD雲端硬碟</font>]<br>[cloud: <font color=''green''>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color=''green''>本地SSD盤</font>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: ${ECSInstanceType}
Label:
en: System Disk Type
zh-cn: 系統硬碟類型
InstanceChargeType:
Type: String
Label:
en: Instance Charge Type
zh-cn: 執行個體的付費方式
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[PostPaid: <font color=''green''>Pay as you go.</font>]<br> [PrePaid: <font color=''green''>Prepaid, monthly subscription.</font>]'
zh-cn: '<font color=''blue''><b>取值:</b></font><br>[PostPaid: <font color=''green''>隨用隨付。</font>]<br>[PrePaid: <font color=''green''>預付費,訂用帳戶。</font>]'
AllowedValues:
- PostPaid
- PrePaid
Default: PostPaid
KeyPairName:
Type: String
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Label:
en: Key Pair Name
zh-cn: 金鑰組名稱
Description:
en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in.</font>
zh-cn: 如果是Windows ECS執行個體,則忽略該參數。預設為空白。<br>如果已填寫<font color='green'>金鑰組名稱</font>,<font color='green'>執行個體密碼</font>的內容仍會被設定到執行個體中,但是Linux系統中的密碼登入方式會被禁止。<br><font color='red'>請輸入已有金鑰組的名稱。如使用執行個體密碼登入,金鑰組名稱不需要填寫。</font>
Default: Null
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VPC
- VSwitch
- SecurityGroup
Label:
default: 'VPC '
- Parameters:
- ECSInstanceType
- ECSDiskCategory
- InstanceChargeType
- KeyPairName
Label:
default: ECS
TemplateTags:
- Specify the image Id and snapshot to create ECS instance.
Resources:
ECSInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
IoOptimized: optimized
InstanceChargeType:
Ref: InstanceChargeType
SystemDisk_Category:
Ref: ECSDiskCategory
SecurityGroupId:
Ref: SecurityGroup
VSwitchId:
Ref: VSwitch
MaxAmount: 1
SystemDisk_Size: 40
VpcId:
Ref: VPC
ImageId: ubuntu_14
InstanceType:
Ref: ECSInstanceType
AllocatePublicIP: 'false'
Password: Admin@123!
KeyPairName:
Ref: KeyPairName
ElasticIp:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 5
InternetChargeType: PayByTraffic
ElasticIpAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Fn::Select:
- 0
- Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
AllocationId:
Ref: ElasticIp
Outputs:
VpcId:
Description: VPC Id
Value:
Ref: VPC
SecurityGroupId:
Description: Security Group Id
Value:
Ref: SecurityGroup
VSwitchId:
Description: VSwitch Id
Value:
Ref: VSwitch
EipAddress:
Description: IP address of created EIP.
Value:
Fn::GetAtt:
- ElasticIp
- EipAddress
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "Create a VPC type ECS and bind EIP (existing VPC).",
"zh-cn": "建立VPC類型ECS,並綁定EIP(已有VPC)。"
},
"Parameters": {
"VPC": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud.",
"zh-cn": "現有專用網路的執行個體ID,在專用網路控制台選擇專用網路進行查詢。"
},
"Label": {
"en": "VPC ID",
"zh-cn": "Virtual Private Cloud執行個體ID"
}
},
"VSwitch": {
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
},
"Type": "String",
"Description": {
"en": "Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch.</font>",
"zh-cn": "現有交換器ID,在專用網路控制台選擇交換器進行查詢,<font color='red'>交換器必須在VPC下。ECS將建立在此交換器下。</font>"
},
"Label": {
"en": "VSwitch ID",
"zh-cn": "交換器執行個體ID"
}
},
"SecurityGroup": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"Description": {
"en": "Please search the business security group ID starting with (sg-xxx) from console-ECS-Network & Security.",
"zh-cn": "現有業務安全性群組的執行個體ID,在ECS控制台選擇安全性群組進行查詢。<br><font color='red'>安全性群組必須歸屬在VPC下。</font>"
},
"Label": {
"en": "Business Security Group ID",
"zh-cn": "業務安全性群組ID"
},
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
}
},
"ECSInstanceType": {
"AssociationPropertyMetadata": {
"InstanceChargeType": "${ECSInstanceType}"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"Type": "String",
"Description": {
"en": "<font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]",
"zh-cn": "<font color='blue'><b>1、選擇機型前請先確認當前可用性區域下該機型是否有貨,部分機型需要提前報備。</b></font><br><font color='blue'><b>2、取值:</font><br></b></font>[ecs.c5.large:<font color='green'>2vCPU 4 GiB,內網頻寬1Gbps、內網收發包30萬PPS。</font>]<br></b>[ecs.c5.xlarge:<font color='green'>4vCPU 8GiB,內網頻寬1.5Gbps、內網收發包50萬PPS。</font>]<br></b>[ecs.c5.2xlarge: <font color='green'>8vCPU 16 GiB,內網頻寬2.5 Gbps、內網收發包80萬PPS。</font>]"
},
"Label": {
"en": "Instance Type",
"zh-cn": "執行個體規格"
}
},
"ECSDiskCategory": {
"Type": "String",
"Description": {
"en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]",
"zh-cn": "<font color='blue'><b>取值:</b></font><br>[cloud_efficiency: <font color='green'>高效雲端硬碟</font>]<br>[cloud_ssd: <font color='green'>SSD雲端硬碟</font>]<br>[cloud_essd: <font color='green'>ESSD雲端硬碟</font>]<br>[cloud: <font color='green'>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color='green'>本地SSD盤</font>]"
},
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"InstanceType": "${ECSInstanceType}"
},
"Label": {
"en": "System Disk Type",
"zh-cn": "系統硬碟類型"
}
},
"InstanceChargeType": {
"Type": "String",
"Label": {
"en": "Instance Charge Type",
"zh-cn": "執行個體的付費方式"
},
"Description": {
"en": "<font color='blue'><b>Optional values:</b></font><br>[PostPaid: <font color='green'>Pay as you go.</font>]<br> [PrePaid: <font color='green'>Prepaid, monthly subscription.</font>]",
"zh-cn": "<font color='blue'><b>取值:</b></font><br>[PostPaid: <font color='green'>隨用隨付。</font>]<br>[PrePaid: <font color='green'>預付費,訂用帳戶。</font>]"
},
"AllowedValues": [
"PostPaid",
"PrePaid"
],
"Default": "PostPaid"
},
"KeyPairName": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName",
"Label": {
"en": "Key Pair Name",
"zh-cn": "金鑰組名稱"
},
"Description": {
"en": "If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in.</font>",
"zh-cn": "如果是Windows ECS執行個體,則忽略該參數。預設為空白。<br>如果已填寫<font color='green'>金鑰組名稱</font>,<font color='green'>執行個體密碼</font>的內容仍會被設定到執行個體中,但是Linux系統中的密碼登入方式會被禁止。<br><font color='red'>請輸入已有金鑰組的名稱。如使用執行個體密碼登入,金鑰組名稱不需要填寫。</font>"
},
"Default": null
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VPC",
"VSwitch",
"SecurityGroup"
],
"Label": {
"default": "VPC "
}
},
{
"Parameters": [
"ECSInstanceType",
"ECSDiskCategory",
"InstanceChargeType",
"KeyPairName"
],
"Label": {
"default": "ECS"
}
}
],
"TemplateTags": [
"Specify the image Id and snapshot to create ECS instance."
]
}
},
"Resources": {
"ECSInstanceGroup": {
"Type": "ALIYUN::ECS::InstanceGroup",
"Properties": {
"IoOptimized": "optimized",
"InstanceChargeType": {
"Ref": "InstanceChargeType"
},
"SystemDisk_Category": {
"Ref": "ECSDiskCategory"
},
"SecurityGroupId": {
"Ref": "SecurityGroup"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"MaxAmount": 1,
"SystemDisk_Size": 40,
"VpcId": {
"Ref": "VPC"
},
"ImageId": "ubuntu_14",
"InstanceType": {
"Ref": "ECSInstanceType"
},
"AllocatePublicIP": "false",
"Password": "Admin@123!",
"KeyPairName": {
"Ref": "KeyPairName"
}
}
},
"ElasticIp": {
"Type": "ALIYUN::VPC::EIP",
"Properties": {
"Bandwidth": 5,
"InternetChargeType": "PayByTraffic"
}
},
"ElasticIpAssociation": {
"Type": "ALIYUN::VPC::EIPAssociation",
"Properties": {
"InstanceId": {
"Fn::Select": [
0,
{
"Fn::GetAtt": [
"ECSInstanceGroup",
"InstanceIds"
]
}
]
},
"AllocationId": {
"Ref": "ElasticIp"
}
}
}
},
"Outputs": {
"VpcId": {
"Description": "VPC Id",
"Value": {
"Ref": "VPC"
}
},
"SecurityGroupId": {
"Description": "Security Group Id",
"Value": {
"Ref": "SecurityGroup"
}
},
"VSwitchId": {
"Description": "VSwitch Id",
"Value": {
"Ref": "VSwitch"
}
},
"EipAddress": {
"Description": "IP address of created EIP.",
"Value": {
"Fn::GetAtt": [
"ElasticIp",
"EipAddress"
]
}
}
}
}情境 2 :建立多個ECS,並綁定EIP。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 建立指定數量的VPC內ECS執行個體,配備EIP,按配置計費與頻寬,於指定交換器與安全性群組下。
en: Provision a specified number of ECS instances within a designated VPC, equipped with Elastic IP Addresses (EIPs), billed by configuration and bandwidth usage, placed under the specified virtual switch (VSwitch) and security group.
Parameters:
VPC:
Type: String
Label:
en: VPC ID
zh-cn: Virtual Private Cloud執行個體ID
Description:
en: Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud
zh-cn: 現有Virtual Private Cloud絡的執行個體ID,控制台-VPC-專用網路下查詢
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitch:
Type: String
Label:
en: VSwitch ID
zh-cn: 交換器執行個體ID
Description:
en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch</font>
zh-cn: 現有交換器ID,控制台-VPC-交換器下查詢,<font color='red'>交換器必須在VPC下。ECS將建立在此交換器下</font>
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
ZoneId: ${ECSZoneId}
SecurityGroup:
Type: String
Label:
en: Business Security Group ID
zh-cn: 業務安全性群組ID
Description:
en: Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security
zh-cn: 現有業務安全性群組的執行個體ID,控制台-ECS-網路與安全-安全性群組下查詢。<br><font color='red'>安全性群組必須歸屬在VPC下。</font>
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VPC}
EIPBandwidth:
Type: Number
Label:
en: EIP Bandwidth
zh-cn: 彈性公網頻寬
Description:
en: 'EIP Bandwidth, Value range: [1,200], unit: Mbps.'
zh-cn: 彈性公網地址頻寬。取值範圍:1~200, 單位:Mbps。
Default: 1
MinValue: 1
MaxValue: 200
EIPInternetChargeType:
Type: String
Label:
en: EIP Charge Type
zh-cn: 彈性公網地址的收費類型
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
Count:
Type: Number
Label:
en: Count
zh-cn: 數量
Description:
en: 'The number of ecs and eip to be created, value range: [1,140]'
zh-cn: 需要建立的ecs和eip的數量,取值範圍:[1,140]
Default: 2
MinValue: 1
MaxValue: 140
ECSZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交換器可用性區域
Description:
en: 'Availability zone ID.<br><b>Note: <font color=''blue''>Before selecting, please confirm whether the availability zone supports the specification of creating ECS resources. It is recommended to be different from other switch availability zones</font></b ><br><font color=''red''>The switch availability zone and the selected switch instance ID must be in the same availability zone.</font>'
zh-cn: 可用性區域ID。<br><b>註: <font color='blue'>選擇前請確認該可用性區域是否支援建立ECS資源的規格,建議與其他交換器可用性區域不同</font></b><br><font color='red'>交換器可用性區域和已選擇的交換器執行個體ID必須在同一個可用性區域。</font>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ECSImageId:
Type: String
Label:
en: Image
zh-cn: 鏡像
Description:
en: Image ID,Please use Centos7, see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find the mirror</font></a></b>
zh-cn: 鏡像ID, 請使用Centos7, 詳見:<b><a href='https://www.alibabacloud.com/help/document_detail/112977.html' target='_blank'><font color='blue'>尋找鏡像</font></a></b>
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${ECSInstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
ECSInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 執行個體規格
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1.選擇機型前請先確認當前可用性區域下該機型是否有貨,部分機型需要提前報備</b></font><br><font color='blue'><b>2.可選機型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB 內網頻寬1Gbps 內網收發包30萬PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB 內網頻寬1.5Gbps 內網收發包50萬PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB 內網頻寬2.5Gbps 內網收發包80萬PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ECSZoneId
ECSDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系統硬碟類型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可選值:</b></font><br>[cloud_efficiency: <font color=''green''>高效雲端硬碟</font>]<br>[cloud_ssd: <font color=''green''>SSD雲端硬碟</font>]<br>[cloud_essd: <font color=''green''>ESSD雲端硬碟</font>]<br>[cloud: <font color=''green''>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color=''green''>本地SSD盤</font>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${ECSInstanceType}
ECSSysDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系統硬碟空間
Description:
en: 'System disk size, range of values: 40-500, units: GB.'
zh-cn: 系統硬碟大小, 取值範圍:[40, 500], 單位:GB。
Default: 40
MinValue: 40
MaxValue: 500
ECSPassword:
Type: String
NoEcho: true
Label:
en: Instance Password
zh-cn: 執行個體密碼
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 伺服器登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。
Default: Null
AssociationProperty: ALIYUN::ECS::Instance::Password
KeyPairName:
Type: String
Label:
en: Key Pair Name
zh-cn: 金鑰組名稱
Description:
en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in</font>
zh-cn: 如果是Windows ECS執行個體,則忽略該參數。預設為空白。<br>如果已填寫<font color='green'>金鑰組名稱</font>,<font color='green'>執行個體密碼</font>的內容仍會被設定到執行個體中,但是Linux系統中的密碼登入方式會被禁止。<br><font color='red'>請輸入已有金鑰組的名稱。如使用執行個體密碼登入,金鑰組名稱不需要填寫</font>
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Default: Null
PayType:
Type: String
Label:
en: ECS Instance Charge Type
zh-cn: ECS付費類型
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
PayPeriodUnit:
Type: String
Label:
en: Pay Period Unit
zh-cn: 購買資源時間長度周期
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: Month
AllowedValues:
- Month
- Year
PayPeriod:
Type: Number
Label:
en: Period
zh-cn: 購買資源時間長度
AssociationProperty: PayPeriod
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: 1
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Resources:
ECSInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: ECSZoneId
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ECSImageId
AllocatePublicIP: 'false'
InstanceChargeType:
Ref: PayType
Period:
Ref: PayPeriod
PeriodUnit:
Ref: PayPeriodUnit
InstanceType:
Ref: ECSInstanceType
IoOptimized: optimized
KeyPairName:
Ref: KeyPairName
MaxAmount:
Ref: Count
Password:
Ref: ECSPassword
SystemDiskCategory:
Ref: ECSDiskCategory
SystemDiskSize:
Ref: ECSSysDiskSize
ElasticIp:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth:
Ref: EIPBandwidth
InternetChargeType:
Ref: EIPInternetChargeType
Count:
Ref: Count
ElasticIpAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Fn::Select:
- Ref: ALIYUN::Index
- Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
AllocationId:
Fn::Select:
- Ref: ALIYUN::Index
- Ref: ElasticIp
Count:
Ref: Count
Outputs:
EipAddress:
Description: IP address of created EIP.
Value:
Fn::GetAtt:
- ElasticIp
- EipAddress
SecurityGroupId:
Description: generated security group id for security group.
Value:
Ref: SecurityGroup
VSwitchId:
Description: generated security vswitch id for VPC.
Value:
Ref: VSwitch
VpcId:
Description: generated security vpc id for VPC.
Value:
Ref: VPC
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VPC
- ECSZoneId
- VSwitch
- SecurityGroup
Label:
default: 'VPC '
- Parameters:
- EIPBandwidth
- EIPInternetChargeType
Label:
default: EIP
- Parameters:
- PayType
- PayPeriodUnit
- PayPeriod
Label:
default:
en: ECS PayType Configuration
zh-cn: ECS付費類型配置
- Parameters:
- ECSInstanceType
- ECSImageId
- ECSDiskCategory
- ECSSysDiskSize
- Count
- ECSPassword
- KeyPairName
Label:
default: ECS
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "建立指定數量的VPC內ECS執行個體,配備EIP,按配置計費與頻寬,於指定交換器與安全性群組下。",
"en": "Provision a specified number of ECS instances within a designated VPC, equipped with Elastic IP Addresses (EIPs), billed by configuration and bandwidth usage, placed under the specified virtual switch (VSwitch) and security group."
},
"Parameters": {
"VPC": {
"Type": "String",
"Label": {
"en": "VPC ID",
"zh-cn": "Virtual Private Cloud執行個體ID"
},
"Description": {
"en": "Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud",
"zh-cn": "現有Virtual Private Cloud絡的執行個體ID,控制台-VPC-專用網路下查詢"
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitch": {
"Type": "String",
"Label": {
"en": "VSwitch ID",
"zh-cn": "交換器執行個體ID"
},
"Description": {
"en": "Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch</font>",
"zh-cn": "現有交換器ID,控制台-VPC-交換器下查詢,<font color='red'>交換器必須在VPC下。ECS將建立在此交換器下</font>"
},
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}",
"ZoneId": "${ECSZoneId}"
}
},
"SecurityGroup": {
"Type": "String",
"Label": {
"en": "Business Security Group ID",
"zh-cn": "業務安全性群組ID"
},
"Description": {
"en": "Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security",
"zh-cn": "現有業務安全性群組的執行個體ID,控制台-ECS-網路與安全-安全性群組下查詢。<br><font color='red'>安全性群組必須歸屬在VPC下。</font>"
},
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
}
},
"EIPBandwidth": {
"Type": "Number",
"Label": {
"en": "EIP Bandwidth",
"zh-cn": "彈性公網頻寬"
},
"Description": {
"en": "EIP Bandwidth, Value range: [1,200], unit: Mbps.",
"zh-cn": "彈性公網地址頻寬。取值範圍:1~200, 單位:Mbps。"
},
"Default": 1,
"MinValue": 1,
"MaxValue": 200
},
"EIPInternetChargeType": {
"Type": "String",
"Label": {
"en": "EIP Charge Type",
"zh-cn": "彈性公網地址的收費類型"
},
"AssociationPropertyMetadata": {
"LocaleKey": "InternetChargeType"
},
"Default": "PayByTraffic",
"AllowedValues": [
"PayByBandwidth",
"PayByTraffic"
]
},
"Count": {
"Type": "Number",
"Label": {
"en": "Count",
"zh-cn": "數量"
},
"Description": {
"en": "The number of ecs and eip to be created, value range: [1,140]",
"zh-cn": "需要建立的ecs和eip的數量,取值範圍:[1,140]"
},
"Default": 2,
"MinValue": 1,
"MaxValue": 140
},
"ECSZoneId": {
"Type": "String",
"Label": {
"en": "VSwitch Availability Zone",
"zh-cn": "交換器可用性區域"
},
"Description": {
"en": "Availability zone ID.<br><b>Note: <font color='blue'>Before selecting, please confirm whether the availability zone supports the specification of creating ECS resources. It is recommended to be different from other switch availability zones</font></b ><br><font color='red'>The switch availability zone and the selected switch instance ID must be in the same availability zone.</font>",
"zh-cn": "可用性區域ID。<br><b>註: <font color='blue'>選擇前請確認該可用性區域是否支援建立ECS資源的規格,建議與其他交換器可用性區域不同</font></b><br><font color='red'>交換器可用性區域和已選擇的交換器執行個體ID必須在同一個可用性區域。</font>"
},
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
},
"ECSImageId": {
"Type": "String",
"Label": {
"en": "Image",
"zh-cn": "鏡像"
},
"Description": {
"en": "Image ID,Please use Centos7, see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find the mirror</font></a></b>",
"zh-cn": "鏡像ID, 請使用Centos7, 詳見:<b><a href='https://www.alibabacloud.com/help/document_detail/112977.html' target='_blank'><font color='blue'>尋找鏡像</font></a></b>"
},
"AssociationProperty": "ALIYUN::ECS::Image::ImageId",
"AssociationPropertyMetadata": {
"InstanceType": "${ECSInstanceType}",
"SupportedImageOwnerAlias": [
"system",
"self",
"others"
]
},
"Default": "centos_7_04_64_20G_alibase_201701015.vhd"
},
"ECSInstanceType": {
"Type": "String",
"Label": {
"en": "Instance Type",
"zh-cn": "執行個體規格"
},
"Description": {
"en": "<font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]",
"zh-cn": "<font color='blue'><b>1.選擇機型前請先確認當前可用性區域下該機型是否有貨,部分機型需要提前報備</b></font><br><font color='blue'><b>2.可選機型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB 內網頻寬1Gbps 內網收發包30萬PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB 內網頻寬1.5Gbps 內網收發包50萬PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB 內網頻寬2.5Gbps 內網收發包80萬PPS</font>]"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "ECSZoneId"
}
},
"ECSDiskCategory": {
"Type": "String",
"Label": {
"en": "System Disk Type",
"zh-cn": "系統硬碟類型"
},
"Description": {
"en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]",
"zh-cn": "<font color='blue'><b>可選值:</b></font><br>[cloud_efficiency: <font color='green'>高效雲端硬碟</font>]<br>[cloud_ssd: <font color='green'>SSD雲端硬碟</font>]<br>[cloud_essd: <font color='green'>ESSD雲端硬碟</font>]<br>[cloud: <font color='green'>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color='green'>本地SSD盤</font>]"
},
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"LocaleKey": "DiskCategory",
"InstanceType": "${ECSInstanceType}"
}
},
"ECSSysDiskSize": {
"Type": "Number",
"Label": {
"en": "System Disk Space",
"zh-cn": "系統硬碟空間"
},
"Description": {
"en": "System disk size, range of values: 40-500, units: GB.",
"zh-cn": "系統硬碟大小, 取值範圍:[40, 500], 單位:GB。"
},
"Default": 40,
"MinValue": 40,
"MaxValue": 500
},
"ECSPassword": {
"Type": "String",
"NoEcho": true,
"Label": {
"en": "Instance Password",
"zh-cn": "執行個體密碼"
},
"Description": {
"en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
"zh-cn": "伺服器登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。"
},
"ConstraintDescription": {
"en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
"zh-cn": "長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。"
},
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Instance::Password"
},
"KeyPairName": {
"Type": "String",
"Label": {
"en": "Key Pair Name",
"zh-cn": "金鑰組名稱"
},
"Description": {
"en": "If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in</font>",
"zh-cn": "如果是Windows ECS執行個體,則忽略該參數。預設為空白。<br>如果已填寫<font color='green'>金鑰組名稱</font>,<font color='green'>執行個體密碼</font>的內容仍會被設定到執行個體中,但是Linux系統中的密碼登入方式會被禁止。<br><font color='red'>請輸入已有金鑰組的名稱。如使用執行個體密碼登入,金鑰組名稱不需要填寫</font>"
},
"AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName",
"Default": null
},
"PayType": {
"Type": "String",
"Label": {
"en": "ECS Instance Charge Type",
"zh-cn": "ECS付費類型"
},
"AssociationProperty": "ChargeType",
"AssociationPropertyMetadata": {
"LocaleKey": "InstanceChargeType"
},
"Default": "PostPaid",
"AllowedValues": [
"PostPaid",
"PrePaid"
]
},
"PayPeriodUnit": {
"Type": "String",
"Label": {
"en": "Pay Period Unit",
"zh-cn": "購買資源時間長度周期"
},
"AssociationProperty": "PayPeriodUnit",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${PayType}",
"PostPaid"
]
}
}
}
},
"Default": "Month",
"AllowedValues": [
"Month",
"Year"
]
},
"PayPeriod": {
"Type": "Number",
"Label": {
"en": "Period",
"zh-cn": "購買資源時間長度"
},
"AssociationProperty": "PayPeriod",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${PayType}",
"PostPaid"
]
}
}
}
},
"Default": 1,
"AllowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9
]
}
},
"Resources": {
"ECSInstanceGroup": {
"Type": "ALIYUN::ECS::InstanceGroup",
"Properties": {
"ZoneId": {
"Ref": "ECSZoneId"
},
"VpcId": {
"Ref": "VPC"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"SecurityGroupId": {
"Ref": "SecurityGroup"
},
"ImageId": {
"Ref": "ECSImageId"
},
"AllocatePublicIP": "false",
"InstanceChargeType": {
"Ref": "PayType"
},
"Period": {
"Ref": "PayPeriod"
},
"PeriodUnit": {
"Ref": "PayPeriodUnit"
},
"InstanceType": {
"Ref": "ECSInstanceType"
},
"IoOptimized": "optimized",
"KeyPairName": {
"Ref": "KeyPairName"
},
"MaxAmount": {
"Ref": "Count"
},
"Password": {
"Ref": "ECSPassword"
},
"SystemDiskCategory": {
"Ref": "ECSDiskCategory"
},
"SystemDiskSize": {
"Ref": "ECSSysDiskSize"
}
}
},
"ElasticIp": {
"Type": "ALIYUN::VPC::EIP",
"Properties": {
"Bandwidth": {
"Ref": "EIPBandwidth"
},
"InternetChargeType": {
"Ref": "EIPInternetChargeType"
}
},
"Count": {
"Ref": "Count"
}
},
"ElasticIpAssociation": {
"Type": "ALIYUN::VPC::EIPAssociation",
"Properties": {
"InstanceId": {
"Fn::Select": [
{
"Ref": "ALIYUN::Index"
},
{
"Fn::GetAtt": [
"ECSInstanceGroup",
"InstanceIds"
]
}
]
},
"AllocationId": {
"Fn::Select": [
{
"Ref": "ALIYUN::Index"
},
{
"Ref": "ElasticIp"
}
]
}
},
"Count": {
"Ref": "Count"
}
}
},
"Outputs": {
"EipAddress": {
"Description": "IP address of created EIP.",
"Value": {
"Fn::GetAtt": [
"ElasticIp",
"EipAddress"
]
}
},
"SecurityGroupId": {
"Description": "generated security group id for security group.",
"Value": {
"Ref": "SecurityGroup"
}
},
"VSwitchId": {
"Description": "generated security vswitch id for VPC.",
"Value": {
"Ref": "VSwitch"
}
},
"VpcId": {
"Description": "generated security vpc id for VPC.",
"Value": {
"Ref": "VPC"
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VPC",
"ECSZoneId",
"VSwitch",
"SecurityGroup"
],
"Label": {
"default": "VPC "
}
},
{
"Parameters": [
"EIPBandwidth",
"EIPInternetChargeType"
],
"Label": {
"default": "EIP"
}
},
{
"Parameters": [
"PayType",
"PayPeriodUnit",
"PayPeriod"
],
"Label": {
"default": {
"en": "ECS PayType Configuration",
"zh-cn": "ECS付費類型配置"
}
}
},
{
"Parameters": [
"ECSInstanceType",
"ECSImageId",
"ECSDiskCategory",
"ECSSysDiskSize",
"Count",
"ECSPassword",
"KeyPairName"
],
"Label": {
"default": "ECS"
}
}
]
}
}
}情境 3 :建立或選擇已有在單個ECS執行個體綁定多個EIP。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 建立指定數量的VPC內ECS執行個體,配備EIP,按配置計費與頻寬,於指定交換器與安全性群組下。
en: Provision a specified number of ECS instances within a designated VPC, equipped with Elastic IP Addresses (EIPs), billed by configuration and bandwidth usage, placed under the specified virtual switch (VSwitch) and security group.
Parameters:
VPC:
Type: String
Label:
en: VPC ID
zh-cn: Virtual Private Cloud執行個體ID
Description:
en: Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud
zh-cn: 現有Virtual Private Cloud絡的執行個體ID,控制台-VPC-專用網路下查詢
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitch:
Type: String
Label:
en: VSwitch ID
zh-cn: 交換器執行個體ID
Description:
en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch</font>
zh-cn: 現有交換器ID,控制台-VPC-交換器下查詢,<font color='red'>交換器必須在VPC下。ECS將建立在此交換器下</font>
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
ZoneId: ${ECSZoneId}
SecurityGroup:
Type: String
Label:
en: Business Security Group ID
zh-cn: 業務安全性群組ID
Description:
en: Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security
zh-cn: 現有業務安全性群組的執行個體ID,控制台-ECS-網路與安全-安全性群組下查詢。<br><font color='red'>安全性群組必須歸屬在VPC下。</font>
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VPC}
EIPBandwidth:
Type: Number
Label:
en: EIP Bandwidth
zh-cn: 彈性公網頻寬
Description:
en: 'EIP Bandwidth, Value range: [1,200], unit: Mbps.'
zh-cn: 彈性公網地址頻寬。取值範圍:1~200, 單位:Mbps。
Default: 1
MinValue: 1
MaxValue: 200
EIPInternetChargeType:
Type: String
Label:
en: EIP Charge Type
zh-cn: 彈性公網地址的收費類型
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
Count:
Type: Number
Label:
en: Count
zh-cn: 數量
Description:
en: 'The number of ecs and eip to be created, value range: [1,140]'
zh-cn: 需要建立的ecs和eip的數量,取值範圍:[1,140]
Default: 2
MinValue: 1
MaxValue: 140
ECSZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交換器可用性區域
Description:
en: 'Availability zone ID.<br><b>Note: <font color=''blue''>Before selecting, please confirm whether the availability zone supports the specification of creating ECS resources. It is recommended to be different from other switch availability zones</font></b ><br><font color=''red''>The switch availability zone and the selected switch instance ID must be in the same availability zone.</font>'
zh-cn: 可用性區域ID。<br><b>註: <font color='blue'>選擇前請確認該可用性區域是否支援建立ECS資源的規格,建議與其他交換器可用性區域不同</font></b><br><font color='red'>交換器可用性區域和已選擇的交換器執行個體ID必須在同一個可用性區域。</font>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ECSImageId:
Type: String
Label:
en: Image
zh-cn: 鏡像
Description:
en: Image ID,Please use Centos7, see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find the mirror</font></a></b>
zh-cn: 鏡像ID, 請使用Centos7, 詳見:<b><a href='https://www.alibabacloud.com/help/document_detail/112977.html' target='_blank'><font color='blue'>尋找鏡像</font></a></b>
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${ECSInstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
ECSInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 執行個體規格
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1.選擇機型前請先確認當前可用性區域下該機型是否有貨,部分機型需要提前報備</b></font><br><font color='blue'><b>2.可選機型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB 內網頻寬1Gbps 內網收發包30萬PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB 內網頻寬1.5Gbps 內網收發包50萬PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB 內網頻寬2.5Gbps 內網收發包80萬PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ECSZoneId
ECSDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系統硬碟類型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可選值:</b></font><br>[cloud_efficiency: <font color=''green''>高效雲端硬碟</font>]<br>[cloud_ssd: <font color=''green''>SSD雲端硬碟</font>]<br>[cloud_essd: <font color=''green''>ESSD雲端硬碟</font>]<br>[cloud: <font color=''green''>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color=''green''>本地SSD盤</font>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${ECSInstanceType}
ECSSysDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系統硬碟空間
Description:
en: 'System disk size, range of values: 40-500, units: GB.'
zh-cn: 系統硬碟大小, 取值範圍:[40, 500], 單位:GB。
Default: 40
MinValue: 40
MaxValue: 500
ECSPassword:
Type: String
NoEcho: true
Label:
en: Instance Password
zh-cn: 執行個體密碼
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 伺服器登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。
Default: Null
AssociationProperty: ALIYUN::ECS::Instance::Password
KeyPairName:
Type: String
Label:
en: Key Pair Name
zh-cn: 金鑰組名稱
Description:
en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in</font>
zh-cn: 如果是Windows ECS執行個體,則忽略該參數。預設為空白。<br>如果已填寫<font color='green'>金鑰組名稱</font>,<font color='green'>執行個體密碼</font>的內容仍會被設定到執行個體中,但是Linux系統中的密碼登入方式會被禁止。<br><font color='red'>請輸入已有金鑰組的名稱。如使用執行個體密碼登入,金鑰組名稱不需要填寫</font>
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Default: Null
PayType:
Type: String
Label:
en: ECS Instance Charge Type
zh-cn: ECS付費類型
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
PayPeriodUnit:
Type: String
Label:
en: Pay Period Unit
zh-cn: 購買資源時間長度周期
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: Month
AllowedValues:
- Month
- Year
PayPeriod:
Type: Number
Label:
en: Period
zh-cn: 購買資源時間長度
AssociationProperty: PayPeriod
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: 1
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Resources:
ECSInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: ECSZoneId
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ECSImageId
AllocatePublicIP: 'false'
InstanceChargeType:
Ref: PayType
Period:
Ref: PayPeriod
PeriodUnit:
Ref: PayPeriodUnit
InstanceType:
Ref: ECSInstanceType
IoOptimized: optimized
KeyPairName:
Ref: KeyPairName
MaxAmount:
Ref: Count
Password:
Ref: ECSPassword
SystemDiskCategory:
Ref: ECSDiskCategory
SystemDiskSize:
Ref: ECSSysDiskSize
ElasticIp:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth:
Ref: EIPBandwidth
InternetChargeType:
Ref: EIPInternetChargeType
Count:
Ref: Count
ElasticIpAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Fn::Select:
- Ref: ALIYUN::Index
- Fn::GetAtt:
- ECSInstanceGroup
- InstanceIds
AllocationId:
Fn::Select:
- Ref: ALIYUN::Index
- Ref: ElasticIp
Count:
Ref: Count
Outputs:
EipAddress:
Description: IP address of created EIP.
Value:
Fn::GetAtt:
- ElasticIp
- EipAddress
SecurityGroupId:
Description: generated security group id for security group.
Value:
Ref: SecurityGroup
VSwitchId:
Description: generated security vswitch id for VPC.
Value:
Ref: VSwitch
VpcId:
Description: generated security vpc id for VPC.
Value:
Ref: VPC
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VPC
- ECSZoneId
- VSwitch
- SecurityGroup
Label:
default: 'VPC '
- Parameters:
- EIPBandwidth
- EIPInternetChargeType
Label:
default: EIP
- Parameters:
- PayType
- PayPeriodUnit
- PayPeriod
Label:
default:
en: ECS PayType Configuration
zh-cn: ECS付費類型配置
- Parameters:
- ECSInstanceType
- ECSImageId
- ECSDiskCategory
- ECSSysDiskSize
- Count
- ECSPassword
- KeyPairName
Label:
default: ECS
{
"ROSTemplateFormatVersion": "2015-09-01",
"Locals": {
"DS_Eip1": {
"Type": "DATASOURCE::EIP::Address",
"Properties": {
"AllocationId": {
"Ref": "EipId1"
}
}
},
"HasEip1": {
"Type": "Eval",
"Value": {
"Fn::Not": {
"Fn::Equals": [
{
"Fn::Length": {
"Ref": "DS_Eip1"
}
},
0
]
}
}
},
"DS_Eip2": {
"Type": "DATASOURCE::EIP::Address",
"Properties": {
"AllocationId": {
"Ref": "EipId2"
}
}
},
"HasEip2": {
"Type": "Eval",
"Value": {
"Fn::Not": {
"Fn::Equals": [
{
"Fn::Length": {
"Ref": "DS_Eip2"
}
},
0
]
}
}
},
"DS_Eip3": {
"Type": "DATASOURCE::EIP::Address",
"Properties": {
"AllocationId": {
"Ref": "EipId3"
}
}
},
"HasEip3": {
"Type": "Eval",
"Value": {
"Fn::Not": {
"Fn::Equals": [
{
"Fn::Length": {
"Ref": "DS_Eip3"
}
},
0
]
}
}
}
},
"Parameters": {
"EcsCondition": {
"Type": "String",
"Label": {
"zh-cn": "是否建立ECS/Eip/Eni",
"en": "Create an ECS/Eip/Eni"
},
"AllowedValues": [
"使用已有ECS/Eip/Eni",
"建立ECS/Eip/Eni"
],
"Default": "使用已有ECS/Eip/Eni"
},
"EcsInstanceId": {
"Type": "String",
"Default": null,
"Label": {
"en": "ECS Instance ID",
"zh-cn": "ECS執行個體ID"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"建立ECS/Eip/Eni"
]
}
}
}
}
},
"ECSNetworkInterfaceId": {
"Type": "String",
"Default": null,
"Label": {
"en": "ECS Network Interface ID",
"zh-cn": "ECS彈性網卡ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"建立ECS/Eip/Eni"
]
}
}
}
}
},
"EipId1": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "Elastic IP Address1 Instance ID",
"zh-cn": "Elastic IP Address1執行個體ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"建立ECS/Eip/Eni"
]
}
}
}
}
},
"EipId2": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "Elastic IP Address2 Instance ID",
"zh-cn": "Elastic IP Address2執行個體ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"建立ECS/Eip/Eni"
]
}
}
}
}
},
"EipId3": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "Elastic IP Address3 Instance ID",
"zh-cn": "Elastic IP Address3執行個體ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"建立ECS/Eip/Eni"
]
}
}
}
}
},
"SystemDiskCategory": {
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"InstanceType": "${InstanceType}",
"ZoneId": "${ZoneId}",
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"使用已有ECS/Eip/Eni"
]
}
}
}
},
"Type": "String",
"Description": {
"zh-cn": "<font color='blue'><b>可選值:</b></font><br>[cloud_efficiency: <font color='green'>高效雲端硬碟</font>]<br>[cloud_ssd: <font color='green'>SSD雲端硬碟</font>]<br>[cloud_essd: <font color='green'>ESSD雲端硬碟</font>]<br>[cloud: <font color='green'>普通雲端硬碟</font>]<br>[ephemeral_ssd: <font color='green'>本地SSD盤</font>]",
"en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]"
},
"Label": {
"zh-cn": "系統磁碟類型",
"en": "System Disk Category"
}
},
"InstancePassword": {
"ConstraintDescription": {
"zh-cn": "長度8-30,必須包含大寫字母、小寫字母、數字、特殊符號三種;特殊字元包括:()`~!@#$%^&*_-+=|{}[]:;' <>,.?/",
"en": "Length 8-30, must contain upper case letters, lower case letters, Numbers, special symbols three; special characters include: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/"
},
"Description": {
"zh-cn": "長度8-30,必須包含大寫字母、小寫字母、數字、特殊符號三個;<br>特殊字元包括:()`~!@#$%^&*_-+=|{}[]:;'<>,.?/",
"en": "The 8-30 long login password of instance, consists of the uppercase, lowercase letter and number. <br> special characters include()`~!@#$%^&*_-+=|{}[]:;'<>,.?/"
},
"MinLength": "8",
"Label": {
"zh-cn": "執行個體密碼",
"en": "Instance Password"
},
"AllowedPattern": "[0-9A-Za-z\\_\\-&:;'<>,=%`~!@#\\(\\)\\$\\^\\*\\+\\|\\{\\}\\[\\]\\.\\?\\/]+$",
"NoEcho": true,
"Default": null,
"MaxLength": "30",
"Type": "String",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"使用已有ECS/Eip/Eni"
]
}
}
}
}
},
"InstanceType": {
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "${ZoneId}",
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"使用已有ECS/Eip/Eni"
]
}
}
}
},
"Type": "String",
"Default": null,
"Label": {
"zh-cn": "執行個體類型",
"en": "Instance Type"
}
},
"ZoneId": {
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"Type": "String",
"Description": {
"zh-cn": "可用性區域ID。<br><b>註: <font color='blue'>選擇可用性區域前請確認該可用性區域是否支援建立ECS資源的規格</font></b>",
"en": "Availability Zone ID,<br><b>note: <font color='blue'>Before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources</font></b>"
},
"Label": {
"zh-cn": "可用性區域ID",
"en": "Available Zone ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"使用已有ECS/Eip/Eni"
]
}
}
}
}
}
},
"Resources": {
"DS_Instances": {
"Condition": "HasEcs",
"Type": "DATASOURCE::ECS::Instances",
"Properties": {
"InstanceIds": [
{
"Ref": "EcsInstanceId"
}
]
}
},
"DS_NetworkInterfaces": {
"Condition": "HasEcs",
"Type": "DATASOURCE::ECS::NetworkInterfaces",
"Properties": {
"NetworkInterfaceIds": [
{
"Ref": "ECSNetworkInterfaceId"
}
]
}
},
"AssignPrivateIpAddresses": {
"Type": "ALIYUN::ECS::AssignPrivateIpAddresses",
"Properties": {
"NetworkInterfaceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"NetworkInterfaceId"
]
},
{
"Ref": "ECSNetworkInterfaceId"
}
]
},
"SecondaryPrivateIpAddressCount": 2
}
},
"EipAssociationPrimaryPrivateIp": {
"DependsOn": [
"AssignPrivateIpAddresses"
],
"Type": "ALIYUN::VPC::EIPAssociation",
"Condition": "EipAssociation1",
"Properties": {
"InstanceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"NetworkInterfaceId"
]
},
{
"Ref": "ECSNetworkInterfaceId"
}
]
},
"AllocationId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"Eip1",
"AllocationId"
]
},
{
"Ref": "EipId1"
}
]
},
"PrivateIpAddress": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"PrivateIpAddress"
]
},
{
"Fn::Jq": [
"First",
".[0].PrivateIpAddress",
{
"Fn::GetAtt": [
"DS_NetworkInterfaces",
"NetworkInterfaces"
]
}
]
}
]
},
"Mode": "NAT"
}
},
"EipAssociationSecondaryPrivateIp1": {
"Type": "ALIYUN::VPC::EIPAssociation",
"Condition": "EipAssociation2",
"DependsOn": [
"EipAssociationPrimaryPrivateIp"
],
"Properties": {
"InstanceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"NetworkInterfaceId"
]
},
{
"Ref": "ECSNetworkInterfaceId"
}
]
},
"AllocationId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"Eip2",
"AllocationId"
]
},
{
"Ref": "EipId2"
}
]
},
"PrivateIpAddress": {
"Fn::Select": [
"0",
{
"Fn::GetAtt": [
"AssignPrivateIpAddresses",
"PrivateIpAddresses"
]
}
]
},
"Mode": "NAT"
}
},
"EipAssociationSecondaryPrivateIp2": {
"DependsOn": [
"EipAssociationSecondaryPrivateIp1"
],
"Condition": "EipAssociation3",
"Type": "ALIYUN::VPC::EIPAssociation",
"Properties": {
"InstanceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"NetworkInterfaceId"
]
},
{
"Ref": "ECSNetworkInterfaceId"
}
]
},
"AllocationId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"Eip3",
"AllocationId"
]
},
{
"Ref": "EipId3"
}
]
},
"PrivateIpAddress": {
"Fn::Select": [
"1",
{
"Fn::GetAtt": [
"AssignPrivateIpAddresses",
"PrivateIpAddresses"
]
}
]
},
"Mode": "NAT"
}
},
"EcsEniAttachment": {
"DependsOn": [
"EipAssociationPrimaryPrivateIp",
"EipAssociationSecondaryPrivateIp1",
"EipAssociationSecondaryPrivateIp2"
],
"Type": "ALIYUN::ECS::NetworkInterfaceAttachment",
"Properties": {
"InstanceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsInstance",
"InstanceId"
]
},
{
"Ref": "EcsInstanceId"
}
]
},
"NetworkInterfaceId": {
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsENI",
"NetworkInterfaceId"
]
},
{
"Ref": "ECSNetworkInterfaceId"
}
]
}
}
},
"WaitConditionHandle": {
"Type": "ALIYUN::ROS::WaitConditionHandle",
"Properties": {}
},
"WaitCondition": {
"Type": "ALIYUN::ROS::WaitCondition",
"Properties": {
"Handle": {
"Ref": "WaitConditionHandle"
},
"Timeout": 3720,
"Count": 1
}
},
"InitEcsEni": {
"Type": "ALIYUN::ECS::RunCommand",
"Properties": {
"InstanceIds": [
{
"Fn::If": [
"CreateEcs",
{
"Fn::GetAtt": [
"EcsInstance",
"InstanceId"
]
},
{
"Ref": "EcsInstanceId"
}
]
}
],
"Type": "RunShellScript",
"Sync": true,
"Timeout": 3600,
"CommandContent": {
"Fn::Sub": [
"#!/bin/bash\nif [ ! -f .ros.provision ]; then\n echo \"Name: 普通模式下實現ECS綁定多EIP(CentOS 7)\" > .ros.provision\nfi\nname=$(grep \"^Name:\" .ros.provision | awk -F':' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')\nif [[ \"$name\" != \"普通模式下實現ECS綁定多EIP(CentOS 7)\" ]]; then\n echo \"當前執行個體已使用過\\\"$name\\\"教程的一鍵配置,不能再使用本教程的一鍵配置\"\n ${WaitConditionHandle.CurlCli} --data-binary \"{\\\"status\\\": \\\"FAILURE\\\", \\\"reason\\\": \\\"The current instance has already applied the configuration of the \\\\\\\"$name\\\\\\\" tutorial, and the configuration of this tutorial can no longer be applied.\\\"}\"\n exit 0\nfi\nsecondary_eni=`ip address show | grep eth | grep DOWN | awk -F: '{print $2}'`\nsecondary_eni_name=`eval echo \"$secondary_eni\"`\nif [[ \"$secondary_eni_name\" != \"\" ]]; then\n echo \"#########################\"\n echo \"# The secondary Eni is not fully configured\"\n echo \"#########################\"\n secondary_eni_mac=`cat /sys/class/net/\"$secondary_eni_name\"/address`\n echo \"DEVICE=$secondary_eni_name\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"BOOTPROTO=dhcp\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"ONBOOT=yes\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"TYPE=Ethernet\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"USERCTL=yes\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"PEERDNS=no\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"IPV6INIT=no\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"PERSISTENT_DHCLIENT=yes\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"HWADDR=$secondary_eni_mac\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n echo \"DEFROUTE=no\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\"\n systemctl restart network\nelse\n echo \"#########################\"\n echo \"# Secondary Eni has been configured\"\n echo \"#########################\"\nfi\nnetmask_address=`ifconfig \"$secondary_eni_name\"| grep netmask | awk '{print $4}'`\necho \"DEVICE=$secondary_eni_name:0\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"TYPE=Ethernet\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"BOOTPROTO=static\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"ONBOOT=yes\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"IPADDR=${PrivateIpAddresses1}\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"NETMASK=$netmask_address\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":0\necho \"DEVICE=$secondary_eni_name:1\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\necho \"TYPE=Ethernet\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\necho \"BOOTPROTO=static\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\necho \"ONBOOT=yes\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\necho \"IPADDR=${PrivateIpAddresses2}\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\necho \"NETMASK=$netmask_address\" >> /etc/sysconfig/network-scripts/ifcfg-\"$secondary_eni_name\":1\nsystemctl restart network\necho \"# Secondary Eni PrivateIpAddresses has been configured\"\n${WaitConditionHandle.CurlCli} --data-binary '{\"status\": \"SUCCESS\"}'\n",
{
"PrivateIpAddresses1": {
"Fn::Select": [
"0",
{
"Fn::GetAtt": [
"AssignPrivateIpAddresses",
"PrivateIpAddresses"
]
}
]
},
"PrivateIpAddresses2": {
"Fn::Select": [
"1",
{
"Fn::GetAtt": [
"AssignPrivateIpAddresses",
"PrivateIpAddresses"
]
}
]
}
}
]
}
},
"DependsOn": [
"EcsEniAttachment"
]
},
"EcsVpc": {
"Condition": "CreateEcs",
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "192.168.0.0/16"
}
},
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Condition": "CreateEcs",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"CidrBlock": "192.168.1.0/24",
"ZoneId": {
"Ref": "ZoneId"
}
}
},
"EcsSecurityGroup": {
"Condition": "CreateEcs",
"Type": "ALIYUN::ECS::SecurityGroup",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
}
}
},
"EcsInstance": {
"Condition": "CreateEcs",
"Type": "ALIYUN::ECS::Instance",
"Properties": {
"SystemDiskCategory": {
"Ref": "SystemDiskCategory"
},
"VpcId": {
"Fn::GetAtt": [
"EcsVpc",
"VpcId"
]
},
"AllocatePublicIP": false,
"SecurityGroupId": {
"Ref": "EcsSecurityGroup"
},
"ImageId": "centos_7",
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"Password": {
"Ref": "InstancePassword"
},
"InstanceType": {
"Ref": "InstanceType"
}
}
},
"EcsENI": {
"Condition": "CreateEcs",
"Type": "ALIYUN::ECS::NetworkInterface",
"Properties": {
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"SecurityGroupId": {
"Ref": "EcsSecurityGroup"
}
}
},
"Eip1": {
"Condition": "CreateEcs",
"Type": "ALIYUN::VPC::EIP",
"Properties": {
"InstanceChargeType": "Postpaid",
"InternetChargeType": "PayByTraffic"
}
},
"Eip2": {
"Condition": "CreateEcs",
"Type": "ALIYUN::VPC::EIP",
"Properties": {
"InstanceChargeType": "Postpaid",
"InternetChargeType": "PayByTraffic"
}
},
"Eip3": {
"Condition": "CreateEcs",
"Type": "ALIYUN::VPC::EIP",
"Properties": {
"InstanceChargeType": "Postpaid",
"InternetChargeType": "PayByTraffic"
}
}
},
"Outputs": {},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"EcsCondition",
"EcsInstanceId",
"ZoneId",
"InstanceType",
"SystemDiskCategory",
"InstancePassword",
"ECSNetworkInterfaceId",
"EipId1",
"EipId2",
"EipId3"
]
}
]
}
},
"Conditions": {
"CreateEcs": {
"Fn::Equals": [
"建立ECS/Eip/Eni",
{
"Ref": "EcsCondition"
}
]
},
"HasEcs": {
"Fn::Equals": [
"使用已有ECS/Eip/Eni",
{
"Ref": "EcsCondition"
}
]
},
"HasEip1": {
"Ref": "HasEip1"
},
"HasEip2": {
"Ref": "HasEip2"
},
"HasEip3": {
"Ref": "HasEip3"
},
"EipAssociation1": {
"Fn::Or": [
"CreateEcs",
"HasEip1"
]
},
"EipAssociation2": {
"Fn::Or": [
"CreateEcs",
"HasEip2"
]
},
"EipAssociation3": {
"Fn::Or": [
"CreateEcs",
"HasEip3"
]
}
},
"Description": {
"zh-cn": "綁定多EIP至CentOS 7 ECS執行個體,通過輔助網卡實現Elastic IP Address擴充。",
"en": "Bind multiple EIPs to a CentOS 7 ECS instance via secondary network interfaces to achieve Elastic Public IP expansion."
}
}更多樣本,請參考包含此資源的公用模板。