Nama Template
ACS-ECS-BulkyAttachInstanceRamRole: Menyambungkan role RAM ke beberapa instans sekaligus.
Deskripsi Template
Menyambungkan role Resource Access Management (RAM) ke beberapa instans Elastic Compute Service (ECS) sekaligus.
Tipe templat
Automation
Pemilik
Alibaba Cloud
Parameter Input
Parameter | Deskripsi | Tipe | Diperlukan | Nilai Default | Batasan |
RamRoleName | Nama peran RAM. | String | Ya | ||
targets | Instans target. | Json | Ya | ||
regionId | ID wilayah. | String | Tidak | {{ ACS::RegionId }} | |
rateControl | Konkurensi eksekusi tugas | Json | Tidak | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | Role RAM yang diasumsikan oleh Operation Orchestration Service (OOS). | String | Tidak | "" |
Parameter Output
Parameter | Deskripsi | Tipe |
instanceIds | List |
Izin yang diperlukan
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:AttachInstanceRamRole",
"ecs:DescribeInstances"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ram:PassRole"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Untuk informasi selengkapnya, lihat ACS-ECS-BulkyAttachInstanceRamRole.yml.
Konten Template
FormatVersion: OOS-2019-06-01
Description:
en: Attaches a RAM role to multiple instances.
zh-cn: Attaches a RAM role to multiple instances.
name-en: ACS-ECS-BulkyAttachInstanceRamRole
name-zh-cn: Attach a RAM role to multiple instances
categories:
- instance_manage
Parameters:
regionId:
Type: String
Label:
en: Region ID
zh-cn: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
RamRoleName:
Label:
en: RAM Role Name
zh-cn: RAM Role Name
Type: String
targets:
Label:
en: Target Instances
zh-cn: Target Instances
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: Concurrency Control
zh-cn: Concurrency Control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: The RAM role assumed by OOS
zh-cn: The RAM role assumed by OOS
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Gets the ECS instances.
zh-cn: Gets the ECS instances.
Action: ACS::SelectTargets
Properties:
RegionId: '{{ regionId }}'
ResourceType: 'ALIYUN::ECS::Instance'
Filters:
- '{{ targets }}'
- Name: attachInstanceRamRole
Action: ACS::ExecuteApi
Description:
en: Attaches the RAM role to the instances.
zh-cn: Attaches the RAM role to the instances.
Properties:
Service: ECS
API: AttachInstanceRamRole
Parameters:
RegionId: '{{ regionId }}'
RamRoleName: '{{ RamRoleName }}'
InstanceIds:
- '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.Instances.Instance[].InstanceId }}'
Outputs:
instanceIds:
Type: List
Value: '{{ getInstance.Instances.Instance[].InstanceId }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- RamRoleName
Label:
default:
zh-cn: Configure Parameters
en: Configure Parameters
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select Instances
en: Select Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Advanced Options