All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceAttributes

Last Updated:Sep 20, 2024

Template name

ACS-ECS-BulkyModifyInstanceAttributes

Execute Now

Template description

Modifies the information of multiple Elastic Compute Service (ECS) instances at a time.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

instanceAttributes

The information about ECS instances.

Json

Yes

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": [
                "ecs:ModifyInstanceAttribute"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

References

For more information, see ACS-ECS-BulkyModifyInstanceAttributes.yml at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky modify the information of an ECS instance
  zh-cn: the description in Chinese
  name-en: ACS-ECS-BulkyModifyInstanceAttributes
  name-zh-cn: the description in Chinese
  categories:
      - instance_manage
Parameters:
  instanceAttributes:
    Description:
      en: 'Format: [{"regionId": "cn-xxx", "instanceId": "i-xxx", "hostName": "", "instanceName": "", "description": "", securityGroups: ["sg-xxx"]}]'
      zh-cn: the description in Chinese
    Label:
      en: InstanceAttributes
      zh-cn: the description in Chinese
    Type: Json
  rateControl:
    Label:
      en: RateControl
      zh-cn: the description in Chinese
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: the description in Chinese
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: modifyInstanceAttribute
  Action: ACS::ECS::ModifyInstanceAttribute
  Description:
    en: Modify the information of an ECS instance
    zh-cn: the description in Chinese
  Properties:
    instanceAttributes: '{{ instanceAttributes }}'
    instanceId: '{{ ACS::TaskLoopItem }}'
  Loop:
    RateControl: '{{ rateControl }}'
    Items:
      'Fn::Jq':
        - All
        - '.[].instanceId'
        - '{{ instanceAttributes }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - instanceAttributes
        Label:
          default:
            zh-cn: the description in Chinese
            en: Instance Attributes
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: the description in Chinese
            en: Control Options