Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyAttachInstanceRamRole

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-BulkyAttachInstanceRamRole : attache un rôle RAM à plusieurs instances.

Exécuter maintenant

description du modèle

Attache un rôle Resource Access Management (RAM) à plusieurs instances Elastic Compute Service (ECS).

type de modèle

Automatisation

Propriétaire

Alibaba Cloud

Paramètres d'entrée

|
**Paramètre**
|
**description**
|
**type**
|
**Obligatoire**
|
**Valeur par défaut**
|
**Contraintes**
| | --- | --- | --- | --- | --- | --- | |
RamRoleName
|
Nom du rôle RAM.
|
String
|
Oui
| | | |
targets
|
Instances cibles.
|
Json
|
Oui
| | | |
regionId
|
ID de la région.
|
String
|
Non
|
{{ ACS::RegionId }}
| | |
rateControl
|
Taux de concurrence pour l'exécution des tâches.
|
Json
|
Non
|
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}
| | |
OOSAssumeRole
|
Rôle RAM endossé par Operation Orchestration Service (OOS).
|
String
|
Non
|
""
| |

Paramètres de sortie

|
**Paramètre**
|
**description**
|
**type**
| | --- | --- | --- | |
instanceIds
| |
List
|

permissions requises

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:AttachInstanceRamRole",
                "ecs:DescribeInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ram:PassRole"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Pour plus d'informations, consultez le fichier ACS-ECS-BulkyAttachInstanceRamRole.yml.

Contenu du modèle

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