Todos los productos
Search
Centro de documentos

CloudOps Orchestration Service:ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId

Última actualización: Sep 05, 2026

Nombre de la plantilla

ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId convierte la dirección IP pública de una instancia en una dirección IP elástica (EIP).

Ejecutar ahora

Descripción de la plantilla

Convierte la dirección IP pública de una instancia de ECS conectada a una VPC en una dirección IP elástica (EIP).

Tipo de plantilla

Automatizada

Propietario

Alibaba Cloud

Parámetros de entrada

Parámetro

Descripción

Tipo

Obligatorio

Valor predeterminado

Límite

instanceId

ID de la instancia de ECS.

String

Sí

OOSAssumeRole

Rol de RAM que asume CloudOps Orchestration Service (OOS).

String

No

""

Parámetros de salida

Parámetro

Descripción

Tipo

AllocationId

String

EipAddress

String

Política de permisos necesaria para ejecutar la plantilla

{
    "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"
        }
    ]
}

Detalles

Detalles de ACS-ECS-ConvertsPublicIPToNewEIPByInstanceId

Contenido de la plantilla

FormatVersion: OOS-2019-06-01
Description:
  en: Converts the public IP address of a VPC-connected ECS instance to another elastic IP address (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: Converts the public IP address of an instance to another elastic IP address.
  categories:
    - instance_manage
Parameters:
  instanceId:
    Label:
      en: InstanceId
      zh-cn: ECS instance ID
    Type: String
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role assumed by OOS
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: modifyInstanceNetworkSpec
  Action: ACS::ExecuteAPI
  Description:
    en: Modifies the network billing method of the ECS instance.
    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: Converts the public IP address of a VPC-connected ECS instance to an elastic IP address (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: Gets the EIP of the ECS instance.
    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: Detaches the EIP from the ECS instance.
    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: Allocates an 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: Waits for the EIP to become available.
    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: Associates the new EIP with the ECS instance.
    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: Select an ECS instance
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options
            en: Advanced options