Nome do modelo
ACS-ECS-BulkyAttachInstanceRamRole: anexa uma função do RAM a várias instâncias.
Descrição do modelo
Anexa uma função do Resource Access Management (RAM) a várias instâncias do Elastic Compute Service (ECS).
Tipo de modelo
Automation
Proprietário
Alibaba Cloud
Parâmetros de entrada
|
Parâmetro |
Descrição |
Tipo |
Obrigatório |
Valor padrão |
Restrições |
|
RamRoleName |
Nome da função do RAM. |
String |
Sim |
||
|
targets |
Instâncias de destino. |
Json |
Sim |
||
|
regionId |
ID da região. |
String |
Não |
{{ ACS::RegionId }} |
|
|
rateControl |
Taxa de concorrência para execução da tarefa. |
Json |
Não |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} |
|
|
OOSAssumeRole |
Função do RAM assumida pelo Operation Orchestration Service (OOS). |
String |
Não |
"" |
Parâmetros de saída
|
Parâmetro |
Descrição |
Tipo |
|
instanceIds |
List |
Permissões necessárias
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:AttachInstanceRamRole",
"ecs:DescribeInstances"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ram:PassRole"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detalhes
Para mais informações, consulte ACS-ECS-BulkyAttachInstanceRamRole.yml.
Conteúdo do modelo
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