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

CloudOps Orchestration Service:ACS-ResourceManager-BulkyMoveResources

最終更新日:Jan 17, 2025

テンプレート名

ACS-ResourceManager-BulkyMoveResources

今すぐ実行

テンプレートの説明

複数のリソースを一度に1つのリソースグループから別のリソースグループに移動します。

テンプレートの種類

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

種類

必須

デフォルト値

制限

resourceIds

リソース ID。

リスト

はい

resourceGroupId

リソースグループ ID。

文字列

はい

resourceType

リソースタイプ。

文字列

はい

regionId

リージョン ID。

文字列

いいえ

{{ ACS::RegionId }}

rateControl

レート制御設定。

JSON

いいえ

{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10}

OOSAssumeRole

CloudOps Orchestration Service (OOS) によって引き受けられる Resource Access Management (RAM) ロール。

文字列

いいえ

""

出力パラメーター

なし

テンプレートを実行するために必要な権限ポリシー

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "resourcemanager:MoveResources"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

参照

詳細については、GitHub の ACS-ResourceManager-BulkyMoveResources をご参照ください。

テンプレートコンテンツ

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky move resources from one resource group to another
  name-en: ACS-ResourceManager-BulkyMoveResources
  categories:
    - security
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  resourceIds:
    Label:
      en: resourceIds
    Type: List
  resourceGroupId:
    Label:
      en: resourceGroup Id
    Type: String
  resourceType:
    Label:
      en: resource type
    Type: String
    AllowedValues:
      - ACS::ECS::Disk
      - ACS::ECS::NetworkInterface
      - ACS::EIP::EipAddress
      - ACS::ECS::Snapshot

  rateControl:
    Label:
      en: RateControl
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: moveResources
    Action: ACS::ExecuteAPI
    Description:
      en: Moves multiple resources from one resource group to another resource group at a time.
    Properties:
      Service: ResourceManager
      API: MoveResources
      Parameters:
        ResourceGroupId: '{{ resourceGroupId }}'
        Resources:
          - ResourceId: '{{ACS::TaskLoopItem }}'
            ResourceType:
              Fn::Select:
                - '{{ resourceType }}'
                - ACS::ECS::Disk: disk
                  ACS::ECS::NetworkInterface: eni
                  ACS::EIP::EipAddress: eip
                  ACS::ECS::Snapshot: snapshot
            RegionId: '{{ regionId }}'
            Service:
              Fn::Select:
                - '{{ resourceType }}'
                - ACS::ECS::Disk: ecs
                  ACS::ECS::NetworkInterface: ecs
                  ACS::EIP::EipAddress: eip
                  ACS::ECS::Snapshot: ecs
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ resourceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - resourceGroupId
          - resourceType
          - resourceIds
        Label:
          default:
            en: Configure Parameters
      - Parameters:
          - OOSAssumeRole
          - RateControl
        Label:
          default:
            en: Control Options