テンプレート名
ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId は、インスタンスのパブリック IP アドレスを Elastic IP アドレス (EIP) に変換します。
テンプレートの説明
VPC 内の Elastic Compute Service (ECS) インスタンスのパブリック IP アドレスを EIP に変換します。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 |
instanceId | ECS インスタンスの ID。 | String | はい | ||
OOSAssumeRole | CloudOps Orchestration Service(OOS)によってアシュームされる Resource Access Management(RAM)ロール。 | String | いいえ | "" |
出力パラメーター
パラメーター | 説明 | タイプ |
AllocationId | String | |
EipAddress | String |
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:AllocateEipAddress",
"ecs:AssociateEipAddress",
"ecs:ConvertNatPublicIpToEip",
"ecs:DescribeInstances",
"ecs:ModifyInstanceNetworkSpec",
"ecs:UnassociateEipAddress"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"vpc:DescribeEipAddresses"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId の詳細
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: VPC に接続された ECS インスタンスのパブリック IP アドレスを別の Elastic IP アドレス (EIP) に変換します。
zh-cn: Converts the public IP address of a VPC-connected ECS instance to another elastic IP address (EIP).
name-en: ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId
name-zh-cn: インスタンスのパブリック IP アドレスを別の Elastic IP アドレスに変換します。
categories:
- instance_manage
Parameters:
instanceId:
Label:
en: インスタンス ID
zh-cn: ECS instance ID
Type: String
OOSAssumeRole:
Label:
en: OOS が偽装する RAM ロール
zh-cn: The RAM role assumed by OOS
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: modifyInstanceNetworkSpec
Action: ACS::ExecuteAPI
Description:
en: ECS インスタンスのネットワーク課金方法を変更します。
zh-cn: Modifies the network billing method of the ECS instance.
Properties:
Service: ECS
API: ModifyInstanceNetworkSpec
Parameters:
InstanceId: '{{ instanceId }}'
NetworkChargeType: PayByTraffic
- Name: convertNatPublicIpToEip
Action: ACS::ExecuteApi
Description:
en: VPC に接続された ECS インスタンスのパブリック IP アドレスを Elastic IP アドレス (EIP) に変換します。
zh-cn: Converts the public IP address of a VPC-connected ECS instance to an elastic IP address (EIP).
Properties:
Service: ECS
API: ConvertNatPublicIpToEip
Parameters:
InstanceId: '{{ instanceId }}'
- Name: getInstanceEIP
Action: ACS::ExecuteApi
Description:
en: ECS インスタンスの EIP を取得します。
zh-cn: Gets the EIP of the ECS instance.
Properties:
Service: ECS
API: DescribeInstances
Parameters:
InstanceId:
- '{{ instanceId }}'
Outputs:
allocationId:
Type: String
ValueSelector: Instances.Instance[].EipAddress.AllocationId
- Name: unassociateEipAddress
Action: ACS::ExecuteApi
Description:
en: ECS インスタンスから EIP をデタッチします。
zh-cn: Detaches the EIP from the ECS instance.
Properties:
Service: ECS
API: UnassociateEipAddress
Parameters:
InstanceId: '{{ instanceId }}'
AllocationId: '{{ getInstanceEIP.allocationId }}'
- Name: AllocateEipAddress
Action: ACS::ExecuteAPI
Description:
en: EIP を割り当てます。
zh-cn: Allocates an EIP.
Properties:
Service: ECS
API: AllocateEipAddress
Parameters: {}
Outputs:
AllocationId:
Type: String
ValueSelector: AllocationId
EipAddress:
Type: String
ValueSelector: EipAddress
- Name: DescribeEipAddresses
Action: ACS::WaitFor
Description:
en: EIP が利用可能になるまで待機します。
zh-cn: Waits for the EIP to become available.
Properties:
Service: VPC
API: DescribeEipAddresses
Parameters:
AllocationId: '{{ AllocateEipAddress.AllocationId }}'
DesiredValues:
- Available
PropertySelector: EipAddresses.EipAddress[].Status
- Name: AssociateEipAddress
Action: ACS::ExecuteAPI
Description:
en: 新しい EIP を ECS インスタンスに関連付けます。
zh-cn: Associates the new EIP with the ECS instance.
Properties:
Service: ECS
API: AssociateEipAddress
Parameters:
InstanceId: '{{ InstanceId }}'
AllocationId: '{{ AllocateEipAddress.AllocationId }}'
Outputs:
AllocationId:
Type: String
Value: '{{ AllocateEipAddress.AllocationId }}'
EipAddress:
Type: String
Value: '{{ AllocateEipAddress.EipAddress }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- instanceId
Label:
default:
zh-cn: Select an ECS instance
en: ECS インスタンスの選択
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: Advanced options
en: 高度なオプション