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

CloudOps Orchestration Service:ACS-ECS-CloneInstancesAcrossAZ

最終更新日:Jun 23, 2026

テンプレート名

ACS-ECS-CloneInstancesAcrossAZ: 同一リージョン内の別のアベイラビリティーゾーンに、1 つ以上の Elastic Compute Service (ECS) インスタンスをクローンします。

[Execute now]

説明

同一リージョン内の別のアベイラビリティーゾーンに、1 つ以上の ECS インスタンスをクローンします。

テンプレートタイプ

Automation

所有者

Alibaba Cloud

入力パラメータ

パラメータ

説明

タイプ

必須

デフォルト

制約

targets

対象インスタンス。

Json

Yes

targetSecurityGroupId

新しいインスタンスのセキュリティグループ ID。

String

Yes

targetVSwitchId

新しいインスタンスの vSwitch ID。宛先のアベイラビリティーゾーンを決定します。

String

Yes

targetTags

新しいインスタンスに追加するタグ。

Json

Yes

regionId

リージョン ID。

String

No

{{ ACS::RegionId }}

targetResourceGroupId

新しいインスタンスのリソースグループ ID。

String

No

targetInstanceType

新しいインスタンスのインスタンスタイプ。

String

No

targetInstanceChargeType

新しいインスタンスの課金方法。

String

No

PostPaid

targetPeriodUnit

サブスクリプション期間の単位。課金方法がサブスクリプション (PrePaid) の場合にのみ必須です。

String

No

targetPeriod

サブスクリプション期間。課金方法がサブスクリプション (PrePaid) の場合にのみ必須です。

Number

No

1

targetDeploymentSetId

新しいインスタンスのデプロイメントセット ID。

String

No

targetInstanceName

新しいインスタンスの名前。

String

No

targetHostName

新しいインスタンスのホスト名。

String

No

rateControl

ループタスクの同時実行とエラー耐性。

Json

No

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

OOSAssumeRole

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

String

No

""

出力パラメータ

パラメータ

説明

タイプ

instanceIds

新しいインスタンスの ID のリスト。

List

必要な権限

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:CreateImage",
                "ecs:DeleteImage",
                "ecs:DescribeAvailableResource",
                "ecs:DescribeDisks",
                "ecs:DescribeImages",
                "ecs:DescribeInstances",
                "ecs:DescribeVSwitches",
                "ecs:RunInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳細

ACS-ECS-CloneInstancesAcrossAZ の詳細

テンプレート内容

FormatVersion: OOS-2019-06-01
Description:
  en: Clones one or more ECS instances to a different availability zone within the same region.
  ja: 同一リージョン内の別のアベイラビリティーゾーンに、1 つ以上の ECS インスタンスをクローンします。
  zh-cn: 跨可用区批量克隆ECS实例
  name-en: ACS-ECS-CloneInstancesAcrossAZ
  name-zh-cn: 跨可用区批量克隆ECS实例
  categories:
    - cross_region
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
      ja: リージョン ID
      zh-cn: 地域ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Label:
      en: Target instances
      ja: 対象インスタンス
      zh-cn: 目标实例
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  targetSecurityGroupId:
    Label:
      en: Target security group ID
      ja: ターゲットセキュリティグループ ID
      zh-cn: 新实例的安全组ID
    Type: String
    AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
    AssociationPropertyMetadata:
      RegionId: regionId
      Filters:
        - SecurityGroupId: targetSecurityGroupId
  targetVSwitchId:
    Label:
      en: Target vSwitch ID
      ja: ターゲット vSwitch ID
      zh-cn: 新实例的交换机ID,填写本参数时将会决定目的可用区
    Type: String
    AssociationProperty: 'ALIYUN::VPC::VSwitch::VSwitchId'
    AssociationPropertyMetadata:
      RegionId: regionId
      Filters:
        - SecurityGroupId: targetSecurityGroupId
  targetResourceGroupId:
    Label:
      en: Target resource group ID
      ja: ターゲットリソースグループ ID
      zh-cn: 新实例将加入的目的资源组ID
    Type: String
    Default: ' '
  targetInstanceType:
    Label:
      en: Target instance type
      ja: ターゲットインスタンスタイプ
      zh-cn: 新实例的规格
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
    AssociationPropertyMetadata:
      RegionId: regionId
    Default: ' '
  targetTags:
    Label:
      en: Target tags
      ja: ターゲットタグ
      zh-cn: 新实例的标签
    Type: Json
    AssociationProperty: Tags
    AssociationPropertyMetadata:
      ShowSystem: false
  targetInstanceChargeType:
    Label:
      en: Billing method
      ja: 課金方法
      zh-cn: 新实例的付费模式,默认按量付费
    Type: String
    AllowedValues:
      - PrePaid
      - PostPaid
    Default: PostPaid
  targetPeriodUnit:
    Label:
      en: Subscription duration unit
      ja: サブスクリプション期間の単位
      zh-cn: 当新实例的付费方式选择包年包月时,请在此处选择时长单位,默认单位是月
    Type: String
    AllowedValues:
      - Week
      - Month
      - ' '
    Default: ' '
  targetPeriod:
    Label:
      en: Subscription duration
      ja: サブスクリプション期間
      zh-cn: 当新实例的付费方式选择包年包月时,请在此处填写时长数,默认值为1
    Type: Number
    Default: 1
  targetDeploymentSetId:
    Label:
      en: Target deployment set ID
      ja: ターゲットデプロイメントセット ID
      zh-cn: 新实例的部署集ID
    Type: String
    Default: ' '
  targetInstanceName:
    Label:
      en: Instance name
      ja: インスタンス名
      zh-cn: 新实例的名称
    Type: String
    Default: ' '
  targetHostName:
    Label:
      en: Hostname
      ja: ホスト名
      zh-cn: 新实例的主机名称
    Type: String
    Default: ' '
  rateControl:
    Label:
      en: Rate control
      ja: レート制御
      zh-cn: 循环任务执行的并发率及容错数
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOS assume role
      ja: OOS が引き受けるロール
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets the target ECS instances.
      ja: 対象の ECS インスタンスを取得します。
      zh-cn: 获取ECS实例
    Action: 'ACS::SelectTargets'
    Properties:
      RegionId: '{{regionId}}'
      ResourceType: 'ALIYUN::ECS::Instance'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'

  - Name: cloneInstancesAcrossAZ
    Action: 'ACS::Template'
    Description:
      en: Clones the instances.
      ja: インスタンスをクローンします。
      zh-cn: 克隆实例
    Properties:
      TemplateName: 'ACS::ECS::CloneInstanceAcrossAZ'
      Parameters:
        imageName: 'img-{{ ACS::TaskLoopItem }}-{{ACS::ExecutionId}}'
        instanceId: '{{ ACS::TaskLoopItem }}'
        targetSecurityGroupId: '{{ targetSecurityGroupId }}'
        targetResourceGroupId: '{{ targetResourceGroupId }}'
        targetVSwitchId: '{{ targetVSwitchId }}'
        regionId: '{{ regionId }}'
        targetInstanceName: '{{ targetInstanceName }}'
        targetInstanceChargeType: '{{ targetInstanceChargeType }}'
        targetPeriodUnit: '{{ targetPeriodUnit }}'
        targetPeriod: '{{ targetPeriod }}'
        targetInstanceType: '{{ targetInstanceType }}'
        targetHostName: '{{ targetHostName }}'
        targetDeploymentSetId: '{{ targetDeploymentSetId }}'
        tags: '{{ targetTags }}'
        OOSAssumeRole: '{{OOSAssumeRole}}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        instanceIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: instanceId
    Outputs:
      instanceId:
        ValueSelector: instanceId
        Type: String
Outputs:
  instanceIds:
    Value: '{{ cloneInstancesAcrossAZ.instanceIds }}'
    Type: List
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - targetSecurityGroupId
          - targetVSwitchId
          - targetInstanceType
          - targetTags
          - targetInstanceChargeType
          - targetPeriodUnit
          - targetPeriod
          - targetResourceGroupId
          - targetDeploymentSetId
          - targetInstanceName
          - targetHostName
        Label:
          default:
            zh-cn: 设置参数
            en: Configure parameters
            ja: パラメーターの設定
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: 选择实例
            en: Select ECS instances
            ja: ECS インスタンスの選択
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 高级选项
            en: Advanced options
            ja: 詳細オプション