ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId
更新時(shí)間:
模板名稱
ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId 將一臺(tái)實(shí)例的公網(wǎng)IP轉(zhuǎn)化為其它彈性公網(wǎng)IP
模板描述
將一臺(tái)網(wǎng)絡(luò)類型為專有網(wǎng)絡(luò)VPC的ECS實(shí)例的公網(wǎng)IP轉(zhuǎn)化為其它彈性公網(wǎng)IP
模板類型
自動(dòng)化
所有者
Alibaba Cloud
輸入?yún)?shù)
參數(shù)名稱 | 描述 | 類型 | 是否必填 | 默認(rèn)值 | 約束 |
instanceId | ECS實(shí)例ID | String | 是 | ||
OOSAssumeRole | OOS扮演的RAM角色 | String | 否 | “” |
輸出參數(shù)
參數(shù)名稱 | 描述 | 類型 |
AllocationId | String | |
EipAddress | String |
執(zhí)行此模板需要的權(quán)限策略
{
"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詳情
模板內(nèi)容
FormatVersion: OOS-2019-06-01
Description:
en: Converts the public IP address of a VPC-connected ECS instance with another Elastic IP (EIP) address
zh-cn: 將一臺(tái)網(wǎng)絡(luò)類型為專有網(wǎng)絡(luò)VPC的ECS實(shí)例的公網(wǎng)IP轉(zhuǎn)化為其它彈性公網(wǎng)IP
name-en: ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId
name-zh-cn: 將一臺(tái)實(shí)例的公網(wǎng)IP轉(zhuǎn)化為其它彈性公網(wǎng)IP
categories:
- instance_manage
Parameters:
instanceId:
Label:
en: InstanceId
zh-cn: ECS實(shí)例ID
Type: String
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: modifyInstanceNetworkSpec
Action: ACS::ExecuteAPI
Description:
en: Modifies the network charge type of the ECS instance with the specified parameters
zh-cn: 轉(zhuǎn)換ECS實(shí)例網(wǎng)絡(luò)付費(fèi)方式
Properties:
Service: ECS
API: ModifyInstanceNetworkSpec
Parameters:
InstanceId: '{{ instanceId }}'
NetworkChargeType: PayByTraffic
- Name: convertNatPublicIpToEip
Action: ACS::ExecuteApi
Description:
en: Converts the public IP address of a VPC-connected ECS instance to an Elastic IP (EIP) address
zh-cn: 將一臺(tái)網(wǎng)絡(luò)類型為專有網(wǎng)絡(luò)VPC的ECS實(shí)例的公網(wǎng)IP轉(zhuǎn)化為彈性公網(wǎng)IP
Properties:
Service: ECS
API: ConvertNatPublicIpToEip
Parameters:
InstanceId: '{{ instanceId }}'
- Name: getInstanceEIP
Action: ACS::ExecuteApi
Description:
en: Gets ECS instance EIP
zh-cn: 獲取實(shí)例彈性公網(wǎng)IP
Properties:
Service: ECS
API: DescribeInstances
Parameters:
InstanceId:
- '{{ instanceId }}'
Outputs:
allocationId:
Type: String
ValueSelector: Instances.Instance[].EipAddress.AllocationId
- Name: unassociateEipAddress
Action: ACS::ExecuteApi
Description:
en: Elastic public network IP (EIP) is unbound from an ECS instacne
zh-cn: 彈性公網(wǎng)IP(EIP)從綁定的ECS實(shí)例上解綁
Properties:
Service: ECS
API: UnassociateEipAddress
Parameters:
InstanceId: '{{ instanceId }}'
AllocationId: '{{ getInstanceEIP.allocationId }}'
- Name: AllocateEipAddress
Action: ACS::ExecuteAPI
Description:
en: Allocate an Eip address
zh-cn: 申請(qǐng)一個(gè)彈性公網(wǎng)IP
Properties:
Service: ECS
API: AllocateEipAddress
Parameters: Null
Outputs:
AllocationId:
Type: String
ValueSelector: AllocationId
EipAddress:
Type: String
ValueSelector: EipAddress
- Name: DescribeEipAddresses
Action: ACS::WaitFor
Description:
en: Waits for the Eip to enter Available status
zh-cn: 等待EIP可用
Properties:
Service: VPC
API: DescribeEipAddresses
Parameters:
AllocationId: '{{ AllocateEipAddress.AllocationId }}'
DesiredValues:
- Available
PropertySelector: EipAddresses.EipAddress[].Status
- Name: AssociateEipAddress
Action: ACS::ExecuteAPI
Description:
en: Bind the new EIP to the ECS instance in the same region
zh-cn: 綁定新EIP到同地域的ECS實(shí)例上
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: 選擇實(shí)例
en: Select Ecs Instances
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: 高級(jí)選項(xiàng)
en: Control Options
文檔內(nèi)容是否對(duì)您有幫助?