Gunakan ALIYUN::VPC::EIPAssociation untuk mengasosiasikan Elastic IP Address (EIP) dengan instans layanan cloud.
Sintaksis
{
"Type": "ALIYUN::VPC::EIPAssociation",
"Properties": {
"AllocationId": String,
"InstanceId": String,
"PrivateIpAddress": String,
"Mode": String
}
} Properti
Property name | Type | Required | Update allowed | Description | Constraint |
AllocationId | String | Yes | Yes | ID EIP. | None |
InstanceId | String | Yes | Yes | ID instans layanan cloud. | Tipe instans layanan cloud yang didukung meliputi:
|
PrivateIpAddress | String | No | Yes | Alamat IP pribadi dalam Blok CIDR vSwitch. | Jika Anda tidak menentukan parameter ini, sistem akan secara otomatis menetapkan alamat IP pribadi berdasarkan ID VPC dan ID vSwitch. |
Mode | String | No | Yes | Mode asosiasi. | Nilai yang valid:
|
Nilai kembalian
Fn::GetAtt
EipAddress: Alamat IP EIP.
AllocationId: ID EIP.
Contoh
Skenario 1: Buat satu instans ECS dan asosiasikan dengan EIP.
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Buat ECS tipe VPC dan ikat EIP (VPC yang ada).
zh-cn: Create a VPC-type ECS instance and bind an EIP (for an existing VPC).
Parameters:
VPC:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Type: String
Description:
en: Silakan cari ID yang diawali dengan (vpc-xxx) dari konsol-Virtual Private Cloud.
zh-cn: The ID of an existing VPC. You can find the ID in the Virtual Private Cloud console.
Label:
en: ID VPC
zh-cn: VPC ID
VSwitch:
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
Type: String
Description:
en: ID VSwitch yang ada, kueri di bawah konsol-VPC-VSwitch, <font color='red'>VSwitch harus berada di bawah VPC. ECS akan dibuat di bawah VSwitch ini.</font>
zh-cn: The ID of an existing vSwitch. You can find the ID in the Virtual Private Cloud console. <font color='red'>The vSwitch must be in the VPC. The ECS instance will be created in this vSwitch.</font>
Label:
en: ID VSwitch
zh-cn: vSwitch ID
SecurityGroup:
Type: String
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
Description:
en: Silakan cari ID grup keamanan bisnis yang diawali dengan (sg-xxx) dari konsol-ECS-Jaringan & Keamanan.
zh-cn: The ID of an existing security group. You can find the ID in the ECS console.<br/><font color='red'>The security group must be in the VPC.</font>
Label:
en: ID Grup Keamanan Bisnis
zh-cn: Security Group ID
AssociationPropertyMetadata:
VpcId: ${VPC}
ECSInstanceType:
AssociationPropertyMetadata:
InstanceChargeType: ${ECSInstanceType}
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
Type: String
Description:
en: <font color='blue'><b>1.Sebelum memilih model, harap konfirmasi bahwa zona ketersediaan saat ini untuk model tersebut memiliki stok. Beberapa model perlu diajukan permintaannya di muka</font><br/><font color='blue'><b>2.Daftar model opsional</font><br></font>[ecs.c5.large <font color='green'>2vCPU 4GiB, bandwidth internal 1Gbps, laju pengalihan paket 30 Juta PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB, bandwidth internal 1,5Gbps, laju pengalihan paket 50 Juta PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB, bandwidth internal 2,5Gbps, laju pengalihan paket 80 Juta PPS</font>]
zh-cn: <font color='blue'><b>1. Before you select an instance type, confirm that it is in stock in the current zone. You may need to submit a request for some instance types in advance.</font><br/><font color='blue'><b>2. Valid values:</font><br/>[ecs.c5.large: <font color='green'>2 vCPUs, 4 GiB of memory, 1 Gbit/s of internal bandwidth, and a packet forwarding rate of 300,000 PPS.</font>]<br/>[ecs.c5.xlarge: <font color='green'>4 vCPUs, 8 GiB of memory, 1.5 Gbit/s of internal bandwidth, and a packet forwarding rate of 500,000 PPS.</font>]<br/>[ecs.c5.2xlarge: <font color='green'>8 vCPUs, 16 GiB of memory, 2.5 Gbit/s of internal bandwidth, and a packet forwarding rate of 800,000 PPS.</font>]
Label:
en: Tipe Instans
zh-cn: Instance Type
ECSDiskCategory:
Type: String
Description:
en: '<font color=''blue''><b>Nilai opsional:</font><br/>[cloud_efficiency: <font color=''green''>disk ultra</font>]<br>[cloud_ssd: <font color=''green''>SSD standar</font>]<br>[cloud_essd: <font color=''green''>SSD Perusahaan (ESSD)</font>]<br>[cloud: <font color=''green''>disk dasar</font>]<br>[ephemeral_ssd: <font color=''green''>SSD lokal</font>]'
zh-cn: '<font color=''blue''><b>Valid values:</font><br/>[cloud_efficiency: <font color=''green''>ultra disk</font>]<br/>[cloud_ssd: <font color=''green''>standard SSD</font>]<br/>[cloud_essd: <font color=''green''>enterprise SSD</font>]<br/>[cloud: <font color=''green''>basic disk</font>]<br/>[ephemeral_ssd: <font color=''green''>local SSD</font>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: ${ECSInstanceType}
Label:
en: Tipe Disk Sistem
zh-cn: System Disk Type
InstanceChargeType:
Type: String
Label:
en: Tipe Penagihan Instans
zh-cn: Instance Billing Method
Description:
en: '<font color=''blue''><b>Nilai opsional:</font><br/>[PostPaid: <font color=''green''>Bayar sesuai pemakaian.</font>]<br> [PrePaid: <font color=''green''>Prabayar, langganan bulanan.</font>]'
zh-cn: '<font color=''blue''><b>Valid values:</font><br/>[PostPaid: <font color=''green''>Pay-as-you-go.</font>]<br/>[PrePaid: <font color=''green''>Subscription.</font>]'
AllowedValues:
- PostPaid
- PrePaid
Default: PostPaid
KeyPairName:
Type: String
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Label:
en: Nama Pasangan Kunci
zh-cn: Key Pair Name
Description:
en: Jika ini adalah instance ECS Windows, abaikan parameter ini. Defaultnya kosong.<br>Jika Anda telah mengisi <font color='green'>nama pasangan kunci</font>, <font color='green'>kata sandi instans< Konten dari /font> akan tetap diatur di instans, tetapi metode login dengan kata sandi di sistem Linux akan dilarang.<br><font color='red'>Harap masukkan nama pasangan kunci yang ada. Jika Anda menggunakan Login dengan kata sandi instans, nama pasangan kunci tidak perlu diisi.</font>
zh-cn: This parameter is ignored for Windows ECS instances. By default, this parameter is left empty.<br>If you specify a <font color='green'>key pair name</font>, the value of the <font color='green'>instance password</font> parameter is still configured for the instance, but password-based logon is disabled for the Linux operating system.<br><font color='red'>Enter the name of an existing key pair. If you use a password to log on to the instance, you do not need to specify a key pair name.</font>
Default: Null
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VPC
- VSwitch
- SecurityGroup
Label:
default: 'VPC '
- Parameters:
- ECSInstanceType
- ECSDiskCategory
- InstanceChargeType
- KeyPairName
Label:
default: ECS
TemplateTags:
- Tentukan Id image dan snapshot untuk membuat instance ECS.
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: Id VPC
Value:
Ref: VPC
SecurityGroupId:
Description: Id Grup Keamanan
Value:
Ref: SecurityGroup
VSwitchId:
Description: Id VSwitch
Value:
Ref: VSwitch
EipAddress:
Description: Alamat IP dari EIP yang dibuat.
Value:
Fn::GetAtt:
- ElasticIp
- EipAddress
<br/><br/><br/><br/><br/><br/>{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "Buat ECS tipe VPC dan ikat EIP (VPC yang ada).",
"zh-cn": "创建VPC类型ECS,并绑定EIP(已有VPC)。"
},
"Parameters": {
"VPC": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "Silakan cari ID yang diawali dengan (vpc-xxx) dari Konsol-Virtual Private Cloud.",
"zh-cn": "现有专有网络的实例ID,在专有网络控制台选择专有网络进行查询。"
},
"Label": {
"en": "ID VPC",
"zh-cn": "专有网络VPC实例ID"
}
},
"VSwitch": {
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
},
"Type": "String",
"Description": {
"en": "ID VSwitch yang ada, kueri di bawah Konsol-VPC-VSwitch, <font color='red'>VSwitch harus berada di bawah VPC. ECS akan dibuat di bawah VSwitch ini.</font>",
"zh-cn": "现有交换机ID,在专有网络控制台选择交换机进行查询,<font color='red'>交换机必须在VPC下。ECS将创建在此交换机下。</font>"
},
"Label": {
"en": "ID VSwitch",
"zh-cn": "交换机实例ID"
}
},
"SecurityGroup": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"Description": {
"en": "Silakan cari ID grup keamanan bisnis yang diawali dengan (sg-xxx) dari Konsol-ECS-Jaringan & Keamanan.",
"zh-cn": "现有业务安全组的实例ID,在ECS控制台选择安全组进行查询。<br/><font color='red'>安全组必须归属在VPC下。</font>"
},
"Label": {
"en": "ID Grup Keamanan Bisnis",
"zh-cn": "业务安全组ID"
},
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
}
},
"ECSInstanceType": {
"AssociationPropertyMetadata": {
"InstanceChargeType": "${ECSInstanceType}"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"Type": "String",
"Description": {
"en": "<font color='blue'><b>1. Sebelum memilih model, konfirmasikan bahwa model tersebut tersedia di zona saat ini. Beberapa model memerlukan notifikasi di muka.</font><br/><font color='blue'><b>2. Model opsional:</font><br/>[ecs.c5.large <font color='green'>2 vCPU, 4 GiB, bandwidth intranet: 1 Gbps, paket pengiriman dan penerimaan intranet: 30 Juta PPS</font>]<br>[ecs.c5.xlarge <font color='green'>4 vCPU, 8 GiB, bandwidth intranet: 1,5 Gbps, paket pengiriman dan penerimaan intranet: 50 Juta PPS</font>]<br>[ecs.c5.2xlarge <font color='green'>8 vCPU, 16 GiB, bandwidth intranet: 2,5 Gbps, paket pengiriman dan penerimaan intranet: 80 Juta PPS</font>]",
"zh-cn": "<font color='blue'><b>1、选择机型前请先确认当前可用区下该机型是否有货,部分机型需要提前报备。</font><br/><font color='blue'><b>2、取值: </font><br></font>[ecs.c5.large: <font color='green'>2vCPU 4 GiB,内网带宽1Gbps、内网收发包30万PPS。</font>]<br>[ecs.c5.xlarge: <font color='green'>4vCPU 8GiB,内网带宽1.5Gbps、内网收发包50万PPS。</font>]<br>[ecs.c5.2xlarge: <font color='green'>8vCPU 16 GiB,内网带宽2.5 Gbps、内网收发包80万PPS。</font>]"
},
"Label": {
"en": "Tipe Instans",
"zh-cn": "实例规格"
}
},
"ECSDiskCategory": {
"Type": "String",
"Description": {
"en": "<font color='blue'><b>Nilai opsional:</font><br/>[cloud_efficiency: <font color='green'>Disk Cloud Efisien</font>]<br>[cloud_ssd: <font color='green'>Disk Cloud SSD</font>]<br>[cloud_essd: <font color='green'>Disk Cloud ESSD</font>]<br>[cloud: <font color='green'>Disk Cloud</font>]<br>[ephemeral_ssd: <font color='green'>Disk Cloud SSD Lokal</font>]",
"zh-cn": "<font color='blue'><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": "Tipe Disk Sistem",
"zh-cn": "系统盘类型"
}
},
"InstanceChargeType": {
"Type": "String",
"Label": {
"en": "Tipe Biaya Instans",
"zh-cn": "实例的付费方式"
},
"Description": {
"en": "<font color='blue'><b>Nilai opsional:</font><br>[PostPaid: <font color='green'>Bayar sesuai pemakaian.</font>]<br> [PrePaid: <font color='green'>Prabayar, langganan bulanan.</font>]",
"zh-cn": "<font color='blue'><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": "Nama Pasangan Kunci",
"zh-cn": "密钥对名称"
},
"Description": {
"en": "Jika ini adalah instance ECS Windows, abaikan parameter ini. Defaultnya kosong.<br>Jika Anda telah mengisi <font color='green'>nama pasangan kunci</font>, <font color='green'>kata sandi instans</font> akan tetap diatur di dalam instans, tetapi metode login kata sandi di sistem Linux akan dilarang.<br><font color='red'>Silakan masukkan nama pasangan kunci yang ada. Jika Anda menggunakan login kata sandi instans, nama pasangan kunci tidak perlu diisi.</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": [
"Tentukan Id image dan Snapshot untuk membuat instance ECS."
]
}
},
"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": "ID VPC",
"Value": {
"Ref": "VPC"
}
},
"SecurityGroupId": {
"Description": "ID Grup Keamanan",
"Value": {
"Ref": "SecurityGroup"
}
},
"VSwitchId": {
"Description": "ID VSwitch",
"Value": {
"Ref": "VSwitch"
}
},
"EipAddress": {
"Description": "Alamat IP dari EIP yang dibuat.",
"Value": {
"Fn::GetAtt": [
"ElasticIp",
"EipAddress"
]
}
}
}
}<br/><br/><br/><br/><br/>Skenario 2: Buat beberapa instans ECS dan asosiasikan dengan EIP
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: Create a specified number of ECS instances in a Virtual Private Cloud (VPC), equipped with Elastic IP addresses (EIPs), billed by configuration and bandwidth usage, and deployed in the specified vSwitch and security group.
en: Menyediakan sejumlah instance ECS yang ditentukan di dalam VPC yang ditentukan, dilengkapi dengan Alamat IP Elastis (EIP), ditagih berdasarkan konfigurasi dan penggunaan bandwidth, ditempatkan di bawah vSwitch dan grup keamanan yang ditentukan.
Parameters:
VPC:
Type: String
Label:
en: ID VPC
zh-cn: the VPC ID.
Description:
en: Cari ID yang diawali dengan vpc-xxx di konsol di bawah Virtual Private Cloud.
zh-cn: Find the ID of your existing VPC in the console under Virtual Private Cloud.
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitch:
Type: String
Label:
en: ID VSwitch
zh-cn: the vSwitch ID.
Description:
en: ID vSwitch yang ada. Temukan di konsol di bawah VPC > vSwitch. <font color='red'>VSwitch harus berada di VPC yang dipilih. Instance ECS akan dibuat di vSwitch ini.</font>
zh-cn: Find the ID of your existing VSwitch in the console under VPC > vSwitch. <font color='red'>The VSwitch must be in the selected VPC. ECS instances will be created in this VSwitch.</font>
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
ZoneId: ${ECSZoneId}
SecurityGroup:
Type: String
Label:
en: ID Grup Keamanan Bisnis
zh-cn: the business security group ID.
Description:
en: Cari ID grup keamanan bisnis yang diawali dengan sg-xxx di konsol di bawah ECS > Jaringan & Keamanan.
zh-cn: Find the ID of your existing business security group in the console under ECS > Network & Security > Security Groups.
<font color='red'>The security group must belong to the selected VPC.</font>
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VPC}
EIPBandwidth:
Type: Number
Label:
en: Bandwidth EIP
zh-cn: Elastic IP address bandwidth.
Description:
en: Bandwidth EIP. Nilai yang valid: 1 hingga 200. Satuan: Mbps.
zh-cn: Elastic IP address bandwidth. Valid values: 1 to 200. Unit: Mbps.
Default: 1
MinValue: 1
MaxValue: 200
EIPInternetChargeType:
Type: String
Label:
en: Jenis Tagihan EIP
zh-cn: EIP charge type.
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
Count:
Type: Number
Label:
en: Jumlah
zh-cn: Count
Description:
en: Jumlah instance ECS dan EIP yang akan dibuat. Nilai yang valid: 1 hingga 140.
zh-cn: Number of ECS instances and EIPs to create. Valid values: 1 to 140.
Default: 2
MinValue: 1
MaxValue: 140
ECSZoneId:
Type: String
Label:
en: Zona Ketersediaan VSwitch
zh-cn: the vSwitch zone
Description:
en: ID zona ketersediaan. <br><b>Catatan: <font color='blue'>Sebelum Anda memilih zona ketersediaan, konfirmasikan bahwa zona tersebut mendukung tipe instans yang akan Anda gunakan. Kami menyarankan untuk memilih zona ketersediaan yang berbeda dari vSwitch lainnya.</font><br/><font color='red'>Zona ketersediaan vSwitch dan ID vSwitch yang dipilih harus cocok.</font>
zh-cn: Availability zone ID. <br><b>Note: <font color='blue'>Before you select an availability zone, confirm that it supports the instance type you plan to use. We recommend choosing a different availability zone than other VSwitches.</font><br/><font color='red'>The availability zone of the VSwitch and the selected VSwitch ID must match.</font>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ECSImageId:
Type: String
Label:
en: Image
zh-cn: Image
Description:
en: ID Image. Gunakan CentOS 7. Untuk detailnya, lihat <b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Temukan image</font></a>.
zh-cn: Image ID. Use CentOS 7. For details, see <b><a href='https://www.alibabacloud.com/help/document_detail/112977.html' target='_blank'><font color='blue'>Find an image</font></a>.
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: Tipe Instans
zh-cn: Instance Type
Description:
en: <font color='blue'><b>1. Sebelum memilih tipe instans, konfirmasikan bahwa tipe tersebut tersedia di zona ketersediaan yang dipilih. Beberapa tipe instans memerlukan pemberitahuan di muka.</font><br/><font color='blue'><b>2. Tipe instans yang tersedia</font><br></font>[ecs.c5.large <font color='green'>2 vCPU, memori 4 GiB, bandwidth internal 1 Gbps, 30 juta PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4 vCPU, memori 8 GiB, bandwidth internal 1,5 Gbps, 50 juta PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8 vCPU, memori 16 GiB, bandwidth internal 2,5 Gbps, 80 juta PPS</font>]
zh-cn: <font color='blue'><b>1. Before selecting an instance type, confirm that it is available in the selected availability zone. Some instance types require advance notice.</font><br/><font color='blue'><b>2. Available instance types</font><br></font>[ecs.c5.large <font color='green'>2 vCPUs, 4 GiB memory, 1 Gbps internal bandwidth, 300,000 PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4 vCPUs, 8 GiB memory, 1.5 Gbps internal bandwidth, 500,000 PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8 vCPUs, 16 GiB memory, 2.5 Gbps internal bandwidth, 800,000 PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ECSZoneId
ECSDiskCategory:
Type: String
Label:
en: Jenis Disk Sistem
zh-cn: System Disk Type
Description:
en: <font color='blue'><b>Nilai yang valid:</font><br/>[cloud_efficiency: <font color='green'>Disk ultra</font>]<br>[cloud_ssd: <font color='green'>SSD Standar</font>]<br>[cloud_essd: <font color='green'>SSD Perusahaan</font>]<br>[cloud: <font color='green'>Disk dasar</font>]<br>[ephemeral_ssd: <font color='green'>Disk SSD lokal</font>]
zh-cn: <font color='blue'><b>Valid values:</font><br>[cloud_efficiency: <font color='green'>Ultra disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>Enterprise SSD</font>]<br>[cloud: <font color='green'>Basic disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD disk</font>]
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${ECSInstanceType}
ECSSysDiskSize:
Type: Number
Label:
en: Ruang Disk Sistem
zh-cn: System Disk Space
Description:
en: Ukuran disk sistem. Nilai yang valid: 40 hingga 500. Satuan: GB.
zh-cn: System disk size. Valid values: 40 to 500. Unit: GB.
Default: 40
MinValue: 40
MaxValue: 500
ECSPassword:
Type: String
NoEcho: true
Label:
en: Kata Sandi Instans
zh-cn: Instance Password
Description:
en: Kata sandi logon server. Panjang: 8 hingga 30 karakter. Harus berisi setidaknya tiga dari berikut ini: huruf besar, huruf kecil, angka, dan karakter khusus seperti ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
zh-cn: Server logon password. Length: 8 to 30 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters such as ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
ConstraintDescription:
en: Panjang: 8 hingga 30 karakter. Harus berisi setidaknya tiga dari berikut ini: huruf besar, huruf kecil, angka, dan karakter khusus seperti ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
zh-cn: Length: 8 to 30 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters such as ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
Default: Null
AssociationProperty: ALIYUN::ECS::Instance::Password
KeyPairName:
Type: String
Label:
en: Nama Pasangan Kunci
zh-cn: Key Pair Name
Description:
en: Abaikan parameter ini jika Anda membuat instance ECS Windows. Nilai defaultnya kosong.<br>Jika Anda menentukan <font color='green'>nama pasangan kunci</font>, <font color='green'>kata sandi instans</font> masih diatur pada instans, tetapi logon berbasis kata sandi dinonaktifkan untuk instans Linux.<br><font color='red'>Masukkan nama pasangan kunci yang ada. Jika Anda menggunakan kata sandi instans untuk logon, biarkan bidang ini kosong.</font>
zh-cn: Ignore this parameter if you are creating a Windows ECS instance. The default value is empty.<br>If you specify a <font color='green'>key pair name</font>, the <font color='green'>instance password</font> is still set on the instance, but password-based logon is disabled for Linux instances.<br><font color='red'>Enter the name of an existing key pair. If you use the instance password to log on, leave this field blank.</font>
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Default: Null
PayType:
Type: String
Label:
en: Jenis Tagihan Instans ECS
zh-cn: ECS instance charge type
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
PayPeriodUnit:
Type: String
Label:
en: Unit Periode Pembayaran
zh-cn: Pay Period Unit
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: Month
AllowedValues:
- Month
- Year
PayPeriod:
Type: Number
Label:
en: Periode
zh-cn: Period
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: Alamat IP dari EIP yang dibuat.
Value:
Fn::GetAtt:
- ElasticIp
- EipAddress
SecurityGroupId:
Description: ID grup keamanan yang dihasilkan untuk grup keamanan.
Value:
Ref: SecurityGroup
VSwitchId:
Description: ID vswitch keamanan yang dihasilkan untuk VPC.
Value:
Ref: VSwitch
VpcId:
Description: ID vpc keamanan yang dihasilkan untuk 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: Konfigurasi PayType ECS
zh-cn: ECS PayType Configuration
- Parameters:
- ECSInstanceType
- ECSImageId
- ECSDiskCategory
- ECSSysDiskSize
- Count
- ECSPassword
- KeyPairName
Label:
default: ECS
<br/><br/><br/>{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建指定数量的VPC内ECS实例,配备EIP,按配置计费与带宽,于指定交换机与安全组下。",
"en": "Menyediakan sejumlah Instance ECS yang ditentukan dalam Virtual Private Cloud (VPC) yang ditentukan, dilengkapi dengan Alamat IP Elastis (EIP), ditagih berdasarkan konfigurasi dan penggunaan bandwidth, ditempatkan di bawah virtual switch (vSwitch) dan grup keamanan yang ditentukan."
},
"Parameters": {
"VPC": {
"Type": "String",
"Label": {
"en": "ID VPC",
"zh-cn": "专有网络VPC实例ID"
},
"Description": {
"en": "Cari ID yang dimulai dengan vpc-xxx di konsol di bawah Virtual Private Cloud.",
"zh-cn": "Find the ID of your existing VPC in the console under Virtual Private Cloud."
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitch": {
"Type": "String",
"Label": {
"en": "ID vSwitch",
"zh-cn": "交换机实例ID"
},
"Description": {
"en": "ID vSwitch yang ada. Temukan di konsol di bawah VPC > vSwitch. <font color='red'>vSwitch harus berada dalam VPC yang dipilih. Instance ECS akan dibuat dalam vSwitch ini.</font>",
"zh-cn": "Find the ID of your existing VSwitch in the console under VPC > vSwitch. <font color='red'>The VSwitch must be in the selected VPC. ECS instances will be created in this VSwitch.</font>"
},
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}",
"ZoneId": "${ECSZoneId}"
}
},
"SecurityGroup": {
"Type": "String",
"Label": {
"en": "ID Grup Keamanan Bisnis",
"zh-cn": "业务安全组ID"
},
"Description": {
"en": "Cari ID grup keamanan bisnis yang dimulai dengan sg-xxx di konsol di bawah ECS > Jaringan & Keamanan.",
"zh-cn": "Find the ID of your existing business security group in the console under ECS > Network & Security > Security Groups.
<font color='red'>The security group must belong to the selected VPC.</font>"
},
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"AssociationPropertyMetadata": {
"VpcId": "${VPC}"
}
},
"EIPBandwidth": {
"Type": "Number",
"Label": {
"en": "Bandwidth EIP",
"zh-cn": "弹性公网带宽"
},
"Description": {
"en": "Bandwidth EIP. Nilai valid: 1 hingga 200. Satuan: Mbps.",
"zh-cn": "Elastic IP address bandwidth. Valid values: 1 to 200. Unit: Mbps."
},
"Default": 1,
"MinValue": 1,
"MaxValue": 200
},
"EIPInternetChargeType": {
"Type": "String",
"Label": {
"en": "Jenis Tagihan EIP",
"zh-cn": "弹性公网地址的收费类型"
},
"AssociationPropertyMetadata": {
"LocaleKey": "InternetChargeType"
},
"Default": "PayByTraffic",
"AllowedValues": [
"PayByBandwidth",
"PayByTraffic"
]
},
"Count": {
"Type": "Number",
"Label": {
"en": "Jumlah",
"zh-cn": "数量"
},
"Description": {
"en": "Jumlah instance ECS dan EIP yang akan dibuat. Nilai valid: 1 hingga 140.",
"zh-cn": "Number of ECS instances and EIPs to create. Valid values: 1 to 140."
},
"Default": 2,
"MinValue": 1,
"MaxValue": 140
},
"ECSZoneId": {
"Type": "String",
"Label": {
"en": "Zona Ketersediaan vSwitch",
"zh-cn": "交换机可用区"
},
"Description": {
"en": "ID zona ketersediaan. <br><b>Catatan: <font color='blue'>Sebelum memilih zona ketersediaan, konfirmasikan bahwa zona tersebut mendukung tipe instans yang akan Anda gunakan. Kami merekomendasikan memilih zona ketersediaan yang berbeda dari vSwitch lainnya.</font><br/><font color='red'>Zona ketersediaan vSwitch dan ID vSwitch yang dipilih harus cocok.</font>",
"zh-cn": "Availability zone ID. <br><b>Note: <font color='blue'>Before you select an availability zone, confirm that it supports the instance type you plan to use. We recommend choosing a different availability zone than other VSwitches.</font><br/><font color='red'>The availability zone of the VSwitch and the selected VSwitch ID must match.</font>"
},
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
},
"ECSImageId": {
"Type": "String",
"Label": {
"en": "Image",
"zh-cn": "镜像"
},
"Description": {
"en": "ID Image. Gunakan CentOS 7. Untuk detailnya, lihat <b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Temukan image</font></a>.",
"zh-cn": "Image ID. Use CentOS 7. For details, see <b><a href='https://www.alibabacloud.com/help/document_detail/112977.html' target='_blank'><font color='blue'>Find an image</font></a>"
},
"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": "Tipe Instans",
"zh-cn": "实例规格"
},
"Description": {
"en": "<font color='blue'><b>1. Sebelum memilih tipe instans, konfirmasikan bahwa tipe tersebut tersedia di zona ketersediaan yang dipilih. Beberapa tipe instans memerlukan pemberitahuan terlebih dahulu.</font><br/><font color='blue'><b>2. Tipe instans yang tersedia</font><br></font>[ecs.c5.large <font color='green'>2 vCPU, 4 GiB memori, bandwidth internal 1 Gbps, 30 juta PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4 vCPU, 8 GiB memori, bandwidth internal 1,5 Gbps, 50 juta PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8 vCPU, 16 GiB memori, bandwidth internal 2,5 Gbps, 80 juta PPS</font>]",
"zh-cn": "<font color='blue'><b>1. Before selecting an instance type, confirm that it is available in the selected availability zone. Some instance types require advance notice.</font><br/><font color='blue'><b>2. Available instance types</font><br></font>[ecs.c5.large <font color='green'>2 vCPUs, 4 GiB memory, 1 Gbps internal bandwidth, 300,000 PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4 vCPUs, 8 GiB memory, 1.5 Gbps internal bandwidth, 500,000 PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8 vCPUs, 16 GiB memory, 2.5 Gbps internal bandwidth, 800,000 PPS</font>]"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "ECSZoneId"
}
},
"ECSDiskCategory": {
"Type": "String",
"Label": {
"en": "Tipe Disk Sistem",
"zh-cn": "系统盘类型"
},
"Description": {
"en": "<font color='blue'><b>Nilai valid:</font><br/>[cloud_efficiency: <font color='green'>Ultra disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>Enterprise SSD</font>]<br>[cloud: <font color='green'>Basic disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD disk</font>]",
"zh-cn": "<font color='blue'><b>Valid values:</font><br>[cloud_efficiency: <font color='green'>Ultra disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>Enterprise SSD</font>]<br>[cloud: <font color='green'>Basic disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD disk</font>]"
},
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"LocaleKey": "DiskCategory",
"InstanceType": "${ECSInstanceType}"
}
},
"ECSSysDiskSize": {
"Type": "Number",
"Label": {
"en": "Ruang Disk Sistem",
"zh-cn": "系统盘空间"
},
"Description": {
"en": "Ukuran disk sistem. Nilai valid: 40 hingga 500. Satuan: GB.",
"zh-cn": "System disk size. Valid values: 40 to 500. Unit: GB."
},
"Default": 40,
"MinValue": 40,
"MaxValue": 500
},
"ECSPassword": {
"Type": "String",
"NoEcho": true,
"Label": {
"en": "Kata Sandi Instans",
"zh-cn": "实例密码"
},
"Description": {
"en": "Kata sandi logon server. Panjang: 8 hingga 30 karakter. Harus mengandung minimal tiga dari berikut ini: huruf kapital, huruf kecil, angka, dan karakter khusus seperti ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.",
"zh-cn": "Server logon password. Length: 8 to 30 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters such as ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/."
},
"ConstraintDescription": {
"en": "Panjang: 8 hingga 30 karakter. Harus mengandung minimal tiga dari berikut ini: huruf kapital, huruf kecil, angka, dan karakter khusus seperti ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.",
"zh-cn": "Length: 8 to 30 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters such as ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/."
},
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Instance::Password"
},
"KeyPairName": {
"Type": "String",
"Label": {
"en": "Nama Pasangan Kunci",
"zh-cn": "密钥对名称"
},
"Description": {
"en": "Abaikan parameter ini jika Anda membuat instance ECS Windows. Nilai default kosong.<br>Jika Anda menentukan <font color='green'>nama pasangan kunci</font>, <font color='green'>kata sandi instans</font> tetap diatur pada instans, tetapi logon berbasis kata sandi dinonaktifkan untuk instance Linux.<br><font color='red'>Masukkan nama pasangan kunci yang sudah ada. Jika Anda menggunakan kata sandi instans untuk logon, biarkan bidang ini kosong.</font>",
"zh-cn": "Ignore this parameter if you are creating a Windows ECS instance. The default value is empty.<br>If you specify a <font color='green'>key pair name</font>, the <font color='green'>instance password</font> is still set on the instance, but password-based logon is disabled for Linux instances.<br><font color='red'>Enter the name of an existing key pair. If you use the instance password to log on, leave this field blank.</font>"
},
"AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName",
"Default": null
},
"PayType": {
"Type": "String",
"Label": {
"en": "Jenis Tagihan Instance ECS",
"zh-cn": "ECS付费类型"
},
"AssociationProperty": "ChargeType",
"AssociationPropertyMetadata": {
"LocaleKey": "InstanceChargeType"
},
"Default": "PostPaid",
"AllowedValues": [
"PostPaid",
"PrePaid"
]
},
"PayPeriodUnit": {
"Type": "String",
"Label": {
"en": "Satuan Periode Pembayaran",
"zh-cn": "购买资源时长周期"
},
"AssociationProperty": "PayPeriodUnit",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${PayType}",
"PostPaid"
]
}
}
}
},
"Default": "Month",
"AllowedValues": [
"Month",
"Year"
]
},
"PayPeriod": {
"Type": "Number",
"Label": {
"en": "Periode",
"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": "Alamat IP dari EIP yang dibuat.",
"Value": {
"Fn::GetAtt": [
"ElasticIp",
"EipAddress"
]
}
},
"SecurityGroupId": {
"Description": "id grup keamanan yang dihasilkan untuk grup keamanan.",
"Value": {
"Ref": "SecurityGroup"
}
},
"VSwitchId": {
"Description": "id vswitch keamanan yang dihasilkan untuk VPC.",
"Value": {
"Ref": "VSwitch"
}
},
"VpcId": {
"Description": "id vpc keamanan yang dihasilkan untuk 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": "Konfigurasi Jenis Pembayaran ECS",
"zh-cn": "ECS付费类型配置"
}
}
},
{
"Parameters": [
"ECSInstanceType",
"ECSImageId",
"ECSDiskCategory",
"ECSSysDiskSize",
"Count",
"ECSPassword",
"KeyPairName"
],
"Label": {
"default": "ECS"
}
}
]
}
}
}<br/><br/><br/>Skenario 3: Pasang beberapa EIP ke satu instans ECS
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Provision a specified number of ECS instances within a designated VPC, equipped with EIPs, billed by configuration and bandwidth usage, and placed in the specified vSwitch and security group.
Parameters:
VPC:
Type: String
Label:
en: VPC ID
Description:
en: The ID of your VPC. Find the ID that starts with vpc- in the Virtual Private Cloud console.
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitch:
Type: String
Label:
en: VSwitch ID
Description:
en: The ID of an existing vSwitch. Find the ID in the console under VPC > vSwitches. <font color='red'>The vSwitch must be in the selected VPC. The ECS instance will be created in this vSwitch.</font>
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VPC}
ZoneId: ${ECSZoneId}
SecurityGroup:
Type: String
Label:
en: Business Security Group ID
Description:
en: The ID of an existing security group. Find the ID that starts with sg- in the console under ECS > Network & Security > Security Groups.
<font color='red'>The security group must be in the selected VPC.</font>
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VPC}
EIPBandwidth:
Type: Number
Label:
en: EIP Bandwidth
Description:
en: 'The bandwidth of the EIP. The value can be from 1 to 200. The unit is Mbps.'
Default: 1
MinValue: 1
MaxValue: 200
EIPInternetChargeType:
Type: String
Label:
en: EIP Charge Type
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Default: PayByTraffic
AllowedValues:
- PayByBandwidth
- PayByTraffic
Count:
Type: Number
Label:
en: Count
Description:
en: 'The number of ECS instances and EIPs to create. The value can be from 1 to 140.'
Default: 2
MinValue: 1
MaxValue: 140
ECSZoneId:
Type: String
Label:
en: VSwitch Availability Zone
Description:
en: 'The ID of the zone.<br><b>Note: <font color=''blue''>Before you select a zone, confirm that it supports the instance type for the ECS resources you want to create. We recommend you select a different zone from other vSwitches.</font></b ><br><font color=''red''>The zone and the selected vSwitch must be the same.</font>'
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
ECSImageId:
Type: String
Label:
en: Image
Description:
en: The ID of the image. Use a CentOS 7 image. For more information, see <b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find an image</font></a>
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
Description:
en: <font color='blue'><b>1. Before you select an instance type, confirm that it is in stock in the current zone. Some instance types require you to apply for them in advance.</font>
<font color='blue'><b>2. Available instance types:</font><br></font>[ecs.c5.large <font color='green'>2 vCPU, 4 GiB, 1 Gbps internal bandwidth, 300,000 PPS</font>]<br/>[ecs.c5.xlarge <font color='green'>4 vCPU, 8 GiB, 1.5 Gbps internal bandwidth, 500,000 PPS</font>]<br/>[ecs.c5.2xlarge <font color='green'>8 vCPU, 16 GiB, 2.5 Gbps internal bandwidth, 800,000 PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ECSZoneId
ECSDiskCategory:
Type: String
Label:
en: System Disk Type
Description:
en: '<font color=''blue''><b>Available values:</font><br>[cloud_efficiency: <font color=''green''>Ultra disk</font>]<br>[cloud_ssd: <font color=''green''>Standard SSD</font>]<br>[cloud_essd: <font color=''green''>ESSD</font>]<br>[cloud: <font color=''green''>Basic disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD</font>]'
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${ECSInstanceType}
ECSSysDiskSize:
Type: Number
Label:
en: System Disk Space
Description:
en: 'The size of the system disk. The value can be from 40 to 500. The unit is GB.'
Default: 40
MinValue: 40
MaxValue: 500
ECSPassword:
Type: String
NoEcho: true
Label:
en: Instance Password
Description:
en: The logon password for the server. The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters from the following set: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
ConstraintDescription:
en: The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters from the following set: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/.
Default: Null
AssociationProperty: ALIYUN::ECS::Instance::Password
KeyPairName:
Type: String
Label:
en: Key Pair Name
Description:
en: This parameter is ignored for Windows ECS instances. The default value is empty.<br>If you specify a <font color='green'>key pair name</font>, the <font color='green'>instance password</font> is still set for the instance, but password-based logon is disabled for the Linux system.<br><font color='red'>Enter the name of an existing key pair. If you use the instance password to log on, do not specify a key pair name.</font>
AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
Default: Null
PayType:
Type: String
Label:
en: ECS Instance Charge Type
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
PayPeriodUnit:
Type: String
Label:
en: Pay Period Unit
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: Month
AllowedValues:
- Month
- Year
PayPeriod:
Type: Number
Label:
en: Period
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 billing configuration
- Parameters:
- ECSInstanceType
- ECSImageId
- ECSDiskCategory
- ECSSysDiskSize
- Count
- ECSPassword
- KeyPairName
Label:
default: ECS
<br/><br/><br/><br/>{
"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": {
"en": "Create an ECS instance, EIP, and ENI"
},
"AllowedValues": [
"Use existing ECS instance, EIP, and ENI",
"Create new ECS instance, EIP, and ENI"
],
"Default": "Use existing ECS instance, EIP, and ENI"
},
"EcsInstanceId": {
"Type": "String",
"Default": null,
"Label": {
"en": "ECS Instance ID"
},
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Create new ECS instance, EIP, and ENI"
]
}
}
}
}
},
"ECSNetworkInterfaceId": {
"Type": "String",
"Default": null,
"Label": {
"en": "ECS Network Interface ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Create new ECS instance, EIP, and ENI"
]
}
}
}
}
},
"EipId1": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "EIP 1 Instance ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Create new ECS instance, EIP, and ENI"
]
}
}
}
}
},
"EipId2": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "EIP 2 Instance ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Create new ECS instance, EIP, and ENI"
]
}
}
}
}
},
"EipId3": {
"Type": "String",
"Default": null,
"AssociationProperty": "ALIYUN::VPC::EIP::AllocationId",
"Label": {
"en": "EIP 3 Instance ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Create new ECS instance, EIP, and ENI"
]
}
}
}
}
},
"SystemDiskCategory": {
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"InstanceType": "${InstanceType}",
"ZoneId": "${ZoneId}",
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Use existing ECS instance, EIP, and ENI"
]
}
}
}
},
"Type": "String",
"Description": {
"en": "<font color='blue'>Available values:</font><br/>[cloud_efficiency: <font color='green'>Ultra disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>ESSD</font>]<br>[cloud: <font color='green'>Basic disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD</font>]"
},
"Label": {
"en": "System Disk Category"
}
},
"InstancePassword": {
"ConstraintDescription": {
"en": "The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include the following: ()`~!@#$%^&*_-+=|{}[]:;' <>,.?/"
},
"Description": {
"en": "The logon password for the instance. The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, and digits. <br> Special characters include the following: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/"
},
"MinLength": "8",
"Label": {
"en": "Instance Password"
},
"AllowedPattern": "[0-9A-Za-z\\_\\-&:;'<>,=%`~!@#\\(\\)\\$\\^\\*\\+\\|\\{\\}\\[\\]\\.\\?\\/]+$",
"NoEcho": true,
"Default": null,
"MaxLength": "30",
"Type": "String",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Use existing ECS instance, EIP, and ENI"
]
}
}
}
}
},
"InstanceType": {
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "${ZoneId}",
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Use existing ECS instance, EIP, and ENI"
]
}
}
}
},
"Type": "String",
"Default": null,
"Label": {
"en": "Instance Type"
}
},
"ZoneId": {
"Default": null,
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"Type": "String",
"Description": {
"en": "The ID of the zone.<br><b>Note: <font color='blue'>Before you select a zone, confirm that it supports the instance type for the ECS resources you want to create.</font>"
},
"Label": {
"en": "Zone ID"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${EcsCondition}",
"Use existing ECS instance, EIP, and 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: Attach multiple EIPs to an ECS instance in NAT mode (CentOS 7)\" > .ros.provision\nfi\nname=$(grep \"^Name:\" .ros.provision | awk -F':' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')\nif [[ \"$name\" != \"Attach multiple EIPs to an ECS instance in NAT mode (CentOS 7)\" ]]; then\n echo \"This instance was already configured using the one-click settings from the \\\"$name\\\" tutorial. You cannot apply the one-click settings from this tutorial again.\"\n ${WaitConditionHandle.CurlCli} --data-binary \"{\\\"status\\\": \\\"FAILURE\\\", \\\"reason\\\": \\\"This instance was already configured using the \\\\\\\"$name\\\\\\\" tutorial. The configuration from this tutorial cannot be applied again.\\\"}\"\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": [
"Create new ECS instance, EIP, and ENI",
{
"Ref": "EcsCondition"
}
]
},
"HasEcs": {
"Fn::Equals": [
"Use existing ECS instance, EIP, and 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": {
"en": "Attach multiple EIPs to a CentOS 7 ECS instance using a secondary ENI."
}
}<br/>Untuk contoh lainnya, lihat templat publik yang mencakup resource ini.