すべてのプロダクト
Search
ドキュメントセンター

CloudOps Orchestration Service:ACS-ESS-LifeCycleReleaseEipAddressFromInstance

最終更新日:Jun 23, 2026

テンプレート名

ACS-ESS-LifeCycleReleaseEipAddressFromInstance

今すぐ実行

テンプレートの説明

ライフサイクルフックを使用して、Elastic Compute Service (ECS) インスタンスに関連付けられた Elastic IP アドレス (EIP) を解放します。スケールイン イベントのみをサポートします。

テンプレートタイプ

自動

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

タイプ

必須

デフォルト値

制限

regionId

リージョン ID です。

String

いいえ

${regionId}

instanceIds

ECS インスタンスの ID のリストです。

List

いいえ

['${instanceIds}']

lifecycleHookId

ライフサイクルフックの ID です。

String

いいえ

${lifecycleHookId}

lifecycleActionToken

インスタンスに関連付けられたスケーリングアクティビティを識別するトークンです。

String

いいえ

${lifecycleActionToken}

rateControl

タスク実行のレート制御設定です。

Json

いいえ

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 5}

OOSAssumeRole

CloudOps Orchestration Service (OOS) が引き受ける RAM ロールです。

String

いいえ

OOSServiceRole

出力パラメーター

なし

テンプレート実行に必要なポリシー

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeEipAddresses",
                "ecs:DescribeInstances",
                "ecs:ReleaseEipAddress",
                "ecs:UnassociateEipAddress"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ess:CompleteLifecycleAction"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

リファレンス

ACS-ESS-LifeCycleReleaseEipAddressFromInstance

テンプレートの内容

FormatVersion: OOS-2019-06-01
Description:
  en: Uses a lifecycle hook to release EIPs in batches from instances (supports scale-in activities only).
  zh-cn: 通过生命周期挂钩批量释放实例上的 EIP (仅支持缩容活动)。
  name-en: ACS-ESS-LifeCycleReleaseEipAddressFromInstance
  name-zh-cn: 使用生命周期挂钩释放实例上的弹性公网IP
  categories:
    - elastic_manage
Parameters:
  regionId:
    Label:
      en: Region ID
      zh-cn: 地域ID
    Description:
      en: The ID of the region.
      zh-cn: 地域ID。请使用弹性伸缩系统默认值 ${regionId}。
    Type: String
    Default: '${regionId}'
  instanceIds:
    Label:
      en: Instance IDs
      zh-cn: ECS实例ID列表
    Description:
      en: The IDs of the ECS instances.
      zh-cn: ECS实例ID列表。请使用弹性伸缩系统默认值 ["${instanceIds}"]。
    Type: List
    Default:
      - '${instanceIds}'
  lifecycleHookId:
    Label:
      en: Lifecycle Hook ID
      zh-cn: 生命周期挂钩ID
    Description:
      en: The ID of the lifecycle hook.
      zh-cn: 生命周期挂钩ID。请使用弹性伸缩系统默认值 ${lifecycleHookId}。
    Type: String
    Default: '${lifecycleHookId}'
  lifecycleActionToken:
    Label:
      en: Lifecycle Action Token
      zh-cn: 标识与实例关联的特定伸缩活动的令牌
    Description:
      en: A token that identifies the scaling activity to which the instance is attached.
      zh-cn: 标识与实例关联的特定伸缩活动的令牌。请使用弹性伸缩系统默认值 ${lifecycleActionToken}。
    Type: String
    Default: '${lifecycleActionToken}'
  rateControl:
    Label:
      en: Rate Control
      zh-cn: 速率控制
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 5
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: releaseEipAddressFromInstance
    Action: 'ACS::ECS::ReleaseEipAddress'
    OnSuccess: CompleteLifecycleActionForContinue
    OnError: CompleteLifecycleActionForAbandon
    Description:
      en: Releases the EIP from the instance.
      zh-cn: 释放实例上的EIP。
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ instanceIds }}'
  - Name: CompleteLifecycleActionForContinue
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Completes the lifecycle action and continues.
      zh-cn: 完成生命周期操作并继续。
    OnSuccess: 'ACS::END'
    Properties:
      Service: ESS
      API: CompleteLifecycleAction
      Parameters:
        RegionId: '{{ regionId }}'
        LifecycleHookId: '{{ lifecycleHookId }}'
        LifecycleActionToken: '{{ lifecycleActionToken }}'
        LifecycleActionResult: CONTINUE
  - Name: CompleteLifecycleActionForAbandon
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Completes the lifecycle action and abandons.
      zh-cn: 完成生命周期操作并放弃。
    Properties:
      Service: ESS
      API: CompleteLifecycleAction
      Parameters:
        RegionId: '{{ regionId }}'
        LifecycleHookId: '{{ lifecycleHookId }}'
        LifecycleActionToken: '{{ lifecycleActionToken }}'
        LifecycleActionResult: ABANDON