Template name
ACS-ResourceManager-BulkyMoveResources
Template description
Moves multiple resources from one resource group to another resource group at a time.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
Parameter | Description | Type | Required | Default value | Limit |
resourceIds | The resource IDs. | List | Yes | ||
resourceGroupId | The resource group ID. | String | Yes | ||
resourceType | The resource type. | String | Yes | ||
regionId | The region ID. | String | No | {{ ACS::RegionId }} | |
rateControl | The rate control settings. | Json | No | {‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10} | |
OOSAssumeRole | The Resource Access Management (RAM) role that is assumed by CloudOps Orchestration Service (OOS). | String | No | "" |
Output parameters
None
Permission policy that is required to execute the template
{
"Version": "1",
"Statement": [
{
"Action": [
"resourcemanager:MoveResources"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
For more information, see ACS-ResourceManager-BulkyMoveResources at GitHub.
Template content
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