ALIYUN::ECS::VPC を使用して、Virtual Private Cloud (VPC) を作成します。
構文
{
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"Description": String,
"Tags": List,
"Ipv6CidrBlock": String,
"EnableIpv6": Boolean,
"ResourceGroupId": String,
"VpcName": String,
"CidrBlock": String,
"Ipv6Isp": String,
"UserCidr": String,
"SecondaryCidrBlocks": List
}
}プロパティ
プロパティ名 | 型 | 必須 | 更新可 | 説明 | 制約 |
ResourceGroupId | String | No | Yes | リソースグループの ID。 | None |
VpcName | String | No | Yes | VPC の名前。 | 値は 2 ~ 128 文字の長さである必要があります。文字または漢字で始まり、 |
CidrBlock | String | No | Yes | VPC の IPv4 CIDR ブロック。 | 有効な値:
|
Description | String | No | Yes | VPC の説明。 | 説明は 2 ~ 256 文字の長さである必要があります。 |
Ipv6CidrBlock | String | No | No | VPC の IPv6 CIDR ブロック。 | None |
EnableIpv6 | Boolean | No | Yes | VPC で IPv6 を有効にするかどうかを指定します。 | 有効な値:
|
Tags | List | No | Yes | タグ | 最大 20 個のタグを追加できます。 詳細については、「タグのプロパティ」をご参照ください。 |
Ipv6Isp | String | No | No | Virtual Private Cloud (VPC) の IPv6 アドレスセグメントのタイプ。 | 有効な値:
|
UserCidr | String | No | No | ユーザー CIDR ブロック。 | 複数の CIDR ブロックを指定するには、コンマ (,) で区切ります。最大 3 つの CIDR ブロックを指定できます。 説明 ユーザー CIDR ブロックの詳細については、「CIDR ブロックのよくある質問」をご参照ください。 |
SecondaryCidrBlocks | List | No | No | SecondaryCidrBlocks | None |
タグの構文
"Tags": [
{
"Value": String,
"Key": String
}
] タグのプロパティ
プロパティ名 | 型 | 必須 | 更新可 | 説明 | 制約 |
Key | String | Yes | No | タグのキー。 | キーは 1 ~ 128 文字の長さである必要があります。 |
Value | String | No | No | タグの値。 | 値は 0 ~ 128 文字の長さである必要があります。 |
戻り値
Fn::GetAtt
VpcId: VPC の ID。
VRouterId: vRouter の ID。
RouteTableId: ルートテーブルの ID。
VpcName: VPC の名前。
例
シナリオ 1: VPC の作成
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcCidrBlock:
Type: String
Label: VPC IPv4 CIDR ブロック
Description: 'CIDR ブロック形式の VPC の IP アドレス範囲。<br>次の IP アドレス範囲とそのサブネットを使用できます。<br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
Default: 192.168.0.0/16
AssociationProperty: ALIYUN::VPC::VPC::CidrBlock
VpcName:
Type: String
Label: VPC 名
Description: VPC の名前。長さは 2 ~ 128 文字で、大文字または小文字の英字または漢字で始まり、数字、アンダースコア (_)、ハイフン (-) を含めることができます。
ConstraintDescription: '名前は 2 ~ 128 文字の長さである必要があります。'
Default: MyVpc
MinLength: 2
MaxLength: 128
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Ref: VpcName
Outputs:
VRouterId:
Description: 作成された VPC のルーター ID。
Value:
Fn::GetAtt:
- Vpc
- VRouterId
RouteTableId:
Description: 作成された VPC のルートテーブル ID。
Value:
Fn::GetAtt:
- Vpc
- RouteTableId
VpcId:
Description: 作成された VPC の ID。
Value:
Fn::GetAtt:
- Vpc
- VpcId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcCidrBlock": {
"Type": "String",
"Label": {
"en": "VPC IPv4 CIDR ブロック"
},
"Description": {
"en": "CIDR ブロック形式の VPC の IP アドレス範囲。<br>次の IP アドレス範囲とそのサブネットを使用できます。<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
},
"Default": "192.168.0.0/16",
"AssociationProperty": "ALIYUN::VPC::VPC::CidrBlock"
},
"VpcName": {
"Type": "String",
"Label": {
"en": "VPC 名"
},
"Description": {
"en": "VPC の名前。長さは 2 ~ 128 文字で、大文字または小文字の英字または漢字で始まり、数字、'_'、または '-' を含めることができます。",
},
"ConstraintDescription": {
"en": "[2, 128] 英字または漢字"
},
"Default": "MyVpc",
"MinLength": 2,
"MaxLength": 128
}
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Ref": "VpcName"
}
}
}
},
"Outputs": {
"VRouterId": {
"Description": "作成された VPC のルーター ID。",
"Value": {
"Fn::GetAtt": [
"Vpc",
"VRouterId"
]
}
},
"RouteTableId": {
"Description": "作成された VPC のルートテーブル ID。",
"Value": {
"Fn::GetAtt": [
"Vpc",
"RouteTableId"
]
}
},
"VpcId": {
"Description": "作成された VPC の ID。",
"Value": {
"Fn::GetAtt": [
"Vpc",
"VpcId"
]
}
}
}
}シナリオ 2: デュアルスタック (IPv4 および IPv6) ECS インスタンスの作成と IPv6 ゲートウェイおよび帯域幅の設定
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: デュアルスタックのクラウドサーバー (ECS) を作成し、VPC、セキュリティグループ、IPv6 ゲートウェイ、帯域幅設定を含む IPv6 パブリック IP を自動的に設定します。
Parameters:
InstanceImageId:
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Description:
en: 'イメージ ID。
Linux の場合は、<font color=''red''><b>centos_7</font> を選択します。
Windows の場合は、<font color=''red''><b>win2008r2、win2012r2、または win2016</font> を選択します。'
Default: centos_7_04_64_20G_alibase_201701015.vhd
Label:
en: イメージ
AssociationProperty: ALIYUN::ECS::Image::ImageId
Type: String
SystemDiskCategory:
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
LocaleKey: DiskCategory
InstanceType: ${InstanceType}
Type: String
Description:
en: '<font color=''blue''>有効な値:</font>
[cloud_efficiency: <font color=''green''>Ultra ディスク</font>]<br/>[cloud_ssd: <font color=''green''>標準 SSD</font>]<br/>[cloud_essd: <font color=''green''>ESSD (エンタープライズ SSD)</font>]<br/>[cloud: <font color=''green''>基本ディスク</font>]<br/>[ephemeral_ssd: <font color=''green''>ローカル SSD</font>]'
Label:
en: システムディスクタイプ
SystemDiskSize:
Default: 40
Type: Number
Description:
en: 'システムディスクのサイズ。単位: GB。有効な値: 20 ~ 500。'
Label:
en: システムディスク容量
VpcCidrBlock:
Default: 192.168.0.0/16
Label:
en: VPC IPv4 CIDR ブロック
Type: String
Description:
en: 'VPC の IPv4 CIDR ブロック。次のいずれかの CIDR ブロックを使用することを推奨します。<br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
InstanceType:
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
Type: String
Description:
en: 'インスタンスタイプ。選択したゾーンでインスタンスタイプが利用可能であることを確認してください。<br>一般的なインスタンスタイプは <font color=''red''><b>ecs.c5.large</font> です。
注: 一部のゾーンでは、すべてのインスタンスタイプがサポートされていない場合があります。<br>詳細については、「<a href=''https://www.alibabacloud.com/help/doc-detail/25378.html'' target=''_blank''><b><font color=''blue''>インスタンスファミリー</font></a>」をご参照ください。'
Label:
en: インスタンスタイプ
InstancePassword:
Description:
en: 'ECS インスタンスのログインパスワード。パスワードは 8 ~ 30 文字の長さで、大文字、小文字、数字、特殊文字 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ のうち少なくとも 3 種類を含める必要があります。'
Type: String
Label:
en: インスタンスパスワード
NoEcho: true
AssociationProperty: ALIYUN::ECS::Instance::Password
ConstraintDescription:
en: 'パスワードは 8 ~ 30 文字の長さで、大文字、小文字、数字、特殊文字 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ のうち少なくとも 3 種類を含める必要があります。'
VSwitchCidrBlock:
Default: 192.168.0.0/24
Type: String
Description:
en: vSwitch の IPv4 CIDR ブロック。CIDR ブロックは VPC のサブネットである必要があります。
Label:
en: vSwitch IPv4 CIDR ブロック
InternetChargeType:
Default: PayByBandwidth
AssociationPropertyMetadata:
LocaleKey: InternetChargeType
Label:
en: IPv6 インターネット帯域幅の課金方法
Type: String
AllowedValues:
- PayByTraffic
- PayByBandwidth
IPV6Bandwidth:
Default: 10
Type: Number
Description:
en: 'IPv6 ゲートウェイのパブリック帯域幅。単位: Mbit/s。有効な値: 1 ~ 5000。課金方法をトラフィック課金に設定した場合、値の範囲は 1 ~ 2000 です。課金方法を帯域幅課金に設定した場合、値の範囲は 1 ~ 5000 です。'
Label:
en: IPv6 ゲートウェイのパブリック帯域幅
VSwitchZoneId:
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
Type: String
Description:
en: 'ゾーンの ID。
<b>注: <font color=''blue''>ゾーンを選択する前に、そのゾーンが作成する ECS リソースをサポートしていることを確認してください。他の vSwitch のゾーンとは異なるゾーンを選択することを推奨します。</font>'
Label:
en: vSwitch ゾーン
InstancePublicIP:
Default: false
Type: Boolean
Description:
en: パブリック IPv4 アドレスを割り当てるかどうかを指定します。
Label:
en: パブリック IPv4 アドレスの割り当て
IPV6GateWaySpec:
AssociationPropertyMetadata:
LocaleKey: NatGatewaySpec
Description:
en: 'IPv6 ゲートウェイのエディション。有効な値: Small (無料版)、Medium (Enterprise Edition)、および Large (Enterprise Enhanced Edition)。'
Default: Small
Label:
en: IPv6 ゲートウェイの仕様
AllowedValues:
- Small
- Medium
- Large
Type: String
Outputs:
EcsInstanceId:
Description: EcsInstance インスタンス ID
Value:
Fn::GetAtt:
- EcsInstance
- InstanceId
EcsInstancePrivateIp:
Description: EcsInstance プライベート IP
Value:
Fn::GetAtt:
- EcsInstance
- PrivateIp
EcsInstanceIpv6Address:
Description: EcsInstance IPv6 アドレス
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsAssignIpv6Addresses
- Ipv6Addresses
Conditions: {}
Resources:
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupIngress:
- Priority: 1
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
PortRange: 3389/3389
- Priority: 1
IpProtocol: all
NicType: intranet
Ipv6SourceCidrIp: '::/0'
PortRange: '-1/-1'
VpcId:
Ref: EcsVpc
SecurityGroupEgress:
- Priority: 1
IpProtocol: tcp
DestCidrIp: 0.0.0.0/0
NicType: intranet
PortRange: 3389/3389
- Ipv6DestCidrIp: '::/0'
IpProtocol: all
Priority: 1
NicType: intranet
PortRange: '-1/-1'
WaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
VpcIpv6InternetBandwidth:
Type: ALIYUN::VPC::Ipv6InternetBandwidth
Properties:
InternetChargeType:
Ref: InternetChargeType
Bandwidth:
Ref: IPV6Bandwidth
Ipv6AddressId:
Fn::Select:
- 0
- Fn::GetAtt:
- EcsAssignIpv6Addresses
- Ipv6AddressIds
Ipv6GatewayId:
Ref: VpcIpv6Gateway
DependsOn:
- EcsAssignIpv6Addresses
- VpcIpv6Gateway
VpcIpv6Gateway:
Type: ALIYUN::VPC::Ipv6Gateway
Properties:
VpcId:
Ref: EcsVpc
Name: MyIpv6Gateway
Spec:
Ref: IPV6GateWaySpec
EcsAssignIpv6Addresses:
Type: ALIYUN::ECS::AssignIpv6Addresses
Properties:
NetworkInterfaceId:
Fn::GetAtt:
- EcsInstance
- PrimaryNetworkInterfaceId
Ipv6AddressCount: 1
DependsOn:
- EcsInstance
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
Ipv6CidrBlock: 0
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
ZoneId:
Ref: VSwitchZoneId
WaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: WaitConditionHandle
Timeout: 900
EcsInstance:
Type: ALIYUN::ECS::Instance
Properties:
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- WaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - '#!/bin/sh'
- |2
- |
cd /opt
- |
wget http://ecs-image-utils.oss-cn-hangzhou.aliyuncs.com/ipv6/rhel/ecs-utils-ipv6
- |
chmod +x ./ecs-utils-ipv6
- |
./ecs-utils-ipv6
- |
ros-notify -d "{\"Data\" : \"SUCCESS\", \"Status\" : \"SUCCESS\"}"
SystemDiskCategory:
Ref: SystemDiskCategory
VpcId:
Ref: EcsVpc
SecurityGroupId:
Ref: EcsSecurityGroup
SystemDiskSize:
Ref: SystemDiskSize
ImageId:
Ref: InstanceImageId
AllocatePublicIP:
Ref: InstancePublicIP
VSwitchId:
Ref: EcsVSwitch
IoOptimized: optimized
Password:
Ref: InstancePassword
InstanceType:
Ref: InstanceType
DependsOn:
- EcsSecurityGroup
- EcsVSwitch
- EcsVpc
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
EnableIpv6: true
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchCidrBlock
- VSwitchZoneId
- InstanceType
- InstanceImageId
- SystemDiskSize
- InstancePublicIP
- InternetChargeType
- IPV6Bandwidth
- IPV6GateWaySpec
- SystemDiskCategory
- InstancePassword
Label:
default: ECS
<br/><br/><br/><br/><br/>
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "デュアルスタックのクラウドサーバー (ECS) を作成し、VPC、セキュリティグループ、IPv6 ゲートウェイ、帯域幅設定を含む IPv6 パブリック IP を自動的に設定します。"
},
"Parameters": {
"InstanceImageId": {
"AssociationPropertyMetadata": {
"InstanceType": "${InstanceType}",
"SupportedImageOwnerAlias": [
"system",
"self",
"others"
]
},
"Description": {
"en": "イメージ ID。
Linux の場合は、<font color='red'><b>centos_7</font> を選択します。<br/>Windows の場合は、<font color='red'><b>win2008r2、win2012r2、または win2016</font> を選択します。"
},
"Default": "centos_7_04_64_20G_alibase_201701015.vhd",
"Label": {
"en": "イメージ"
},
"AssociationProperty": "ALIYUN::ECS::Image::ImageId",
"Type": "String"
},
"SystemDiskCategory": {
"AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
"AssociationPropertyMetadata": {
"LocaleKey": "DiskCategory",
"InstanceType": "${InstanceType}"
},
"Type": "String",
"Description": {
"en": "<font color='blue'><b>有効値:</font><br/>[cloud_efficiency: <font color='green'>Ultra ディスク</font>]<br>[cloud_ssd: <font color='green'>標準 SSD</font>]<br>[cloud_essd: <font color='green'>ESSD (エンタープライズ SSD)</font>]<br>[cloud: <font color='green'>基本ディスク</font>]<br>[ephemeral_ssd: <font color='green'>ローカル SSD</font>]"
},
"Label": {
"en": "システムディスクタイプ"
}
},
"SystemDiskSize": {
"Default": 40,
"Type": "Number",
"Description": {
"en": "システムディスクのサイズ。 単位: GB。 有効値: 20~500。"
},
"Label": {
"en": "システムディスク容量"
}
},
"VpcCidrBlock": {
"Default": "192.168.0.0/16",
"Label": {
"en": "VPC IPv4 CIDR ブロック"
},
"Type": "String",
"Description": {
"en": "VPC の IPv4 CIDR ブロック。 次のいずれかの CIDR ブロックの使用を推奨します:<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
},
"AllowedValues": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8"
]
},
"InstanceType": {
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "VSwitchZoneId"
},
"Type": "String",
"Description": {
"en": "インスタンスタイプ。 選択したゾーンでインスタンスタイプが利用可能であることを確認してください。<br>一般的なインスタンスタイプは <font color='red'><b>ecs.c5.large</font> です。<br/>注: 一部のゾーンでは、すべてのインスタンスタイプがサポートされていない場合があります。<br>詳細については、「<a href='https://www.alibabacloud.com/help/en/doc-detail/25378.html' target='_blank'><b><font color='blue'>インスタンスファミリー</font></a>」をご参照ください。"
},
"Label": {
"en": "インスタンスタイプ"
}
},
"InstancePassword": {
"Description": {
"en": "ECS インスタンスのログインパスワード。 パスワードは 8~30 文字で、大文字、小文字、数字、特殊文字 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/. のうち、3 種類以上を含める必要があります。"
},
"Type": "String",
"Label": {
"en": "インスタンスのパスワード"
},
"NoEcho": true,
"AssociationProperty": "ALIYUN::ECS::Instance::Password",
"ConstraintDescription": {
"en": "パスワードは 8~30 文字で、大文字、小文字、数字、特殊文字 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/. のうち、3 種類以上を含める必要があります。"
}
},
"VSwitchCidrBlock": {
"Default": "192.168.0.0/24",
"Type": "String",
"Description": {
"en": "vSwitch の IPv4 CIDR ブロック。 CIDR ブロックは VPC のサブネットである必要があります。"
},
"Label": {
"en": "vSwitch IPv4 CIDR ブロック"
}
},
"InternetChargeType": {
"Default": "PayByBandwidth",
"AssociationPropertyMetadata": {
"LocaleKey": "InternetChargeType"
},
"Label": {
"en": "IPv6 インターネット帯域幅の課金方法"
},
"Type": "String",
"AllowedValues": [
"PayByTraffic",
"PayByBandwidth"
]
},
"IPV6Bandwidth": {
"Default": 10,
"Type": "Number",
"Description": {
"en": "IPv6 ゲートウェイのパブリック帯域幅。 単位: Mbit/s。 有効値: 1~5000。 課金方法をトラフィック課金に設定した場合、有効値は 1~2000 です。 課金方法を帯域幅課金に設定した場合、有効値は 1~5000 です。"
},
"Label": {
"en": "IPv6 ゲートウェイのパブリック帯域幅"
}
},
"VSwitchZoneId": {
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
"Type": "String",
"Description": {
"en": "ゾーンの ID。<br/><b>注: <font color='blue'>ゾーンを選択する前に、そのゾーンが作成する ECS リソースをサポートしていることを確認してください。 他の vSwitch のゾーンとは異なるゾーンを選択することを推奨します。</font>"
},
"Label": {
"en": "vSwitch ゾーン"
}
},
"InstancePublicIP": {
"Default": false,
"Type": "Boolean",
"Description": {
"en": "パブリック IPv4 アドレスを割り当てるかどうかを指定します。"
},
"Label": {
"en": "パブリック IPv4 アドレスの割り当て"
}
},
"IPV6GateWaySpec": {
"AssociationPropertyMetadata": {
"LocaleKey": "NatGatewaySpec"
},
"Description": {
"en": "IPv6 ゲートウェイのエディション。 有効値: Small (無料版)、Medium (Enterprise Edition)、Large (Enterprise Enhanced Edition)。"
},
"Default": "Small",
"Label": {
"en": "IPv6 ゲートウェイ仕様"
},
"AllowedValues": [
"Small",
"Medium",
"Large"
],
"Type": "String"
}
},
"Outputs": {
"EcsInstanceId": {
"Description": "EcsInstance の InstanceId",
"Value": {
"Fn::GetAtt": [
"EcsInstance",
"InstanceId"
]
}
},
"EcsInstancePrivateIp": {
"Description": "EcsInstance の PrivateIp",
"Value": {
"Fn::GetAtt": [
"EcsInstance",
"PrivateIp"
]
}
},
"EcsInstanceIpv6Address": {
"Description": "EcsInstance の Ipv6Address",
"Value": {
"Fn::Select": [
"0",
{
"Fn::GetAtt": [
"EcsAssignIpv6Addresses",
"Ipv6Addresses"
]
}
]
}
}
},
"Conditions": {},
"Resources": {
"EcsSecurityGroup": {
"Type": "ALIYUN::ECS::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
{
"Priority": 1,
"IpProtocol": "tcp",
"NicType": "intranet",
"SourceCidrIp": "0.0.0.0/0",
"PortRange": "3389/3389"
},
{
"Priority": 1,
"IpProtocol": "all",
"NicType": "intranet",
"Ipv6SourceCidrIp": "::/0",
"PortRange": "-1/-1"
}
],
"VpcId": {
"Ref": "EcsVpc"
},
"SecurityGroupEgress": [
{
"Priority": 1,
"IpProtocol": "tcp",
"DestCidrIp": "0.0.0.0/0",
"NicType": "intranet",
"PortRange": "3389/3389"
},
{
"Ipv6DestCidrIp": "::/0",
"IpProtocol": "all",
"Priority": 1,
"NicType": "intranet",
"PortRange": "-1/-1"
}
]
}
},
"WaitConditionHandle": {
"Type": "ALIYUN::ROS::WaitConditionHandle",
"Properties": {}
},
"VpcIpv6InternetBandwidth": {
"Type": "ALIYUN::VPC::Ipv6InternetBandwidth",
"Properties": {
"InternetChargeType": {
"Ref": "InternetChargeType"
},
"Bandwidth": {
"Ref": "IPV6Bandwidth"
},
"Ipv6AddressId": {
"Fn::Select": [
0,
{
"Fn::GetAtt": [
"EcsAssignIpv6Addresses",
"Ipv6AddressIds"
]
}
]
},
"Ipv6GatewayId": {
"Ref": "VpcIpv6Gateway"
}
},
"DependsOn": [
"EcsAssignIpv6Addresses",
"VpcIpv6Gateway"
]
},
"VpcIpv6Gateway": {
"Type": "ALIYUN::VPC::Ipv6Gateway",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"Name": "MyIpv6Gateway",
"Spec": {
"Ref": "IPV6GateWaySpec"
}
}
},
"EcsAssignIpv6Addresses": {
"Type": "ALIYUN::ECS::AssignIpv6Addresses",
"Properties": {
"NetworkInterfaceId": {
"Fn::GetAtt": [
"EcsInstance",
"PrimaryNetworkInterfaceId"
]
},
"Ipv6AddressCount": 1
},
"DependsOn": [
"EcsInstance"
]
},
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"Ipv6CidrBlock": 0,
"VpcId": {
"Ref": "EcsVpc"
},
"CidrBlock": {
"Ref": "VSwitchCidrBlock"
},
"ZoneId": {
"Ref": "VSwitchZoneId"
}
}
},
"WaitCondition": {
"Type": "ALIYUN::ROS::WaitCondition",
"Properties": {
"Count": 1,
"Handle": {
"Ref": "WaitConditionHandle"
},
"Timeout": 900
}
},
"EcsInstance": {
"Type": "ALIYUN::ECS::Instance",
"Properties": {
"UserData": {
"Fn::Replace": [
{
"ros-notify": {
"Fn::GetAtt": [
"WaitConditionHandle",
"CurlCli"
]
}
},
{
"Fn::Join": [
"",
[
"#!/bin/sh",
" \n",
"cd /opt \n",
"wget http://ecs-image-utils.oss-cn-hangzhou.aliyuncs.com/ipv6/rhel/ecs-utils-ipv6 \n",
"chmod +x ./ecs-utils-ipv6 \n",
"./ecs-utils-ipv6 \n",
"ros-notify -d \"{\\\"Data\\\" : \\\"SUCCESS\\\", \\\"Status\\\" : \\\"SUCCESS\\\"}\" \n"
]
]
}
]
},
"SystemDiskCategory": {
"Ref": "SystemDiskCategory"
},
"VpcId": {
"Ref": "EcsVpc"
},
"SecurityGroupId": {
"Ref": "EcsSecurityGroup"
},
"SystemDiskSize": {
"Ref": "SystemDiskSize"
},
"ImageId": {
"Ref": "InstanceImageId"
},
"AllocatePublicIP": {
"Ref": "InstancePublicIP"
},
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"IoOptimized": "optimized",
"Password": {
"Ref": "InstancePassword"
},
"InstanceType": {
"Ref": "InstanceType"
}
},
"DependsOn": [
"EcsSecurityGroup",
"EcsVSwitch",
"EcsVpc"
]
},
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
},
"EnableIpv6": true
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VpcCidrBlock",
"VSwitchCidrBlock",
"VSwitchZoneId",
"InstanceType",
"InstanceImageId",
"SystemDiskSize",
"InstancePublicIP",
"InternetChargeType",
"IPV6Bandwidth",
"IPV6GateWaySpec",
"SystemDiskCategory",
"InstancePassword"
],
"Label": {
"default": "ECS"
}
}
]
}
}
}<br/><br/><br/><br/><br/>
シナリオ 3: VPC タイプ Classic Load Balancer (CLB) インスタンスの作成
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: VPC と vSwitch を作成し、内部向け Server Load Balancer (SLB) インスタンスを設定します。インスタンスタイプとアドレスタイプを指定できます。
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR ブロック
Description:
en: 'VPC の IPv4 CIDR ブロック。次の CIDR ブロックまたはそのサブネットを使用できます: 10.0.0.0/8、172.16.0.0/12、および 192.168.0.0/16。'
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchZoneId:
Type: String
Label:
en: ゾーン ID
Default: Null
Description:
en: ゾーンの ID。ゾーンが SLB をサポートしていることを確認してください。
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VSwitchCidrBlock:
Type: String
Label:
en: vSwitch CIDR ブロック
Description:
en: vSwitch の CIDR ブロック。VPC のサブネットである必要があり、他の vSwitch で使用されていない必要があります。
Default: 192.168.0.0/24
LoadBalancerSpec:
Type: String
Label:
en: 仕様
Description:
en: 'SLB インスタンスの仕様。詳細については、「<a href=''https://www.alibabacloud.com/help/document_detail/85939.html'' target=''_blank''><font color=''blue''>SLB インスタンスの仕様</font></a>」をご参照ください。'
Default: slb.s1.small
Conditions: {}
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
VSwitchName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
AddressType: intranet
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
PayType: PayOnDemand
DependsOn: EcsVSwitch
Outputs:
SlbLoadBalancerId:
Description:
en: SLB インスタンスの ID。
Value:
Fn::GetAtt:
- SlbLoadBalancer
- LoadBalancerId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchZoneId
- VSwitchCidrBlock
Label:
default:
en: VPC
- Parameters:
- LoadBalancerSpec
Label:
default:
en: SLB
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "VPC と vSwitch を作成し、内部向け Server Load Balancer (SLB) インスタンスを設定します。インスタンスタイプとアドレスタイプを指定できます。"
},
"Parameters": {
"VpcCidrBlock": {
"Type": "String",
"Label": {
"en": "VPC CIDR ブロック"
},
"Description": {
"en": "VPC の IPv4 CIDR ブロック。次の CIDR ブロックまたはそのサブネットを使用できます: 10.0.0.0/8、172.16.0.0/12、および 192.168.0.0/16。"
},
"Default": "192.168.0.0/16",
"AllowedValues": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8"
]
},
"VSwitchZoneId": {
"Type": "String",
"Label": {
"en": "ゾーン ID"
},
"Default": null,
"Description": {
"en": "ゾーンの ID。ゾーンが SLB をサポートしていることを確認してください。"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"VSwitchCidrBlock": {
"Type": "String",
"Label": {
"en": "vSwitch CIDR ブロック"
},
"Description": {
"en": "vSwitch の CIDR ブロック。VPC のサブネットである必要があり、他の vSwitch で使用されていない必要があります。"
},
"Default": "192.168.0.0/24"
},
"LoadBalancerSpec": {
"Type": "String",
"Label": {
"en": "仕様"
},
"Description": {
"en": "SLB インスタンスの仕様。詳細については、「<a href='https://www.alibabacloud.com/help/document_detail/85939.html' target='_blank'><font color='blue'>SLB インスタンスの仕様</font>」をご参照ください。"
},
"Default": "slb.s1.small"
}
},
"Conditions": {},
"Resources": {
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": {
"Ref": "VpcCidrBlock"
},
"VpcName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
}
}
},
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"ZoneId": {
"Ref": "VSwitchZoneId"
},
"VpcId": {
"Ref": "EcsVpc"
},
"CidrBlock": {
"Ref": "VSwitchCidrBlock"
},
"VSwitchName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
}
}
},
"SlbLoadBalancer": {
"Type": "ALIYUN::SLB::LoadBalancer",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"AddressType": "intranet",
"LoadBalancerName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
},
"LoadBalancerSpec": {
"Ref": "LoadBalancerSpec"
},
"PayType": "PayOnDemand"
},
"DependsOn": "EcsVSwitch"
}
},
"Outputs": {
"SlbLoadBalancerId": {
"Description": {
"en": "SLB インスタンスの ID。"
},
"Value": {
"Fn::GetAtt": [
"SlbLoadBalancer",
"LoadBalancerId"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"VpcCidrBlock",
"VSwitchZoneId",
"VSwitchCidrBlock"
],
"Label": {
"default": {
"en": "VPC"
}
}
},
{
"Parameters": [
"LoadBalancerSpec"
],
"Label": {
"default": {
"en": "SLB"
}
}
}
]
}
}
}その他の例については、「このリソースを含む公開テンプレート」をご参照ください。