All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandAcrossRegions

Last Updated:Jun 22, 2026

Template name

Runs Cloud Assistant commands in batches on Elastic Compute Service (ECS) instances across multiple regions.

Execute now

Description

Runs Cloud Assistant commands in batches on ECS instances across multiple regions.

Template type

Automation

Owner

Alibaba Cloud

Input parameters

Parameter name

Description

Type

Required

Default value

Constraints

instanceInfos

The ECS instances on which to run the command.

List

No

[]

commandType

The type of the Cloud Assistant command.

String

No

RunShellScript

commandContent

The command to run on the ECS instances.

String

No

echo hello

timeout

The timeout period for command execution. Unit: seconds.

Number

No

600

rateControl

The concurrency rate for task execution.

Json

No

{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10}

OOSAssumeRole

The RAM role to be assumed by OOS.

String

No

“”

Output parameters

Parameter name

Description

Type

commandOutputs

List

Required access policy

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInvocationResults",
                "ecs:DescribeInvocations",
                "ecs:RunCommand"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Details

Details for ACS-ECS-BulkyRunCommandAcrossRegions

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky run command on ECS instances across multiple regions
  name-en: ACS-ECS-BulkyRunCommandAcrossRegions
  categories:
    - run_command
Parameters:
  instanceInfos:
    Description:
      en: 'Format: {"regionId": "cn-xxx", "instanceId": "i-xxx"}'
    Label:
      en: InstanceInfos
    Type: List
    Default: []
  commandType:
    Label:
      en: CommandType
    Type: String
    AllowedValues:
      - RunBatScript
      - RunPowerShellScript
      - RunShellScript
    Default: RunShellScript
  commandContent:
    Label:
      en: CommandContent
    Type: String
    AssociationProperty: Code
    Default: echo hello
  timeout:
    Label:
      en: Timeout
    Type: Number
    Default: 600
  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: runCommand
    Action: ACS::ECS::RunCommand
    Description:
      en: Execute cloud assistant command
    Properties:
      regionId:
        'Fn::Select':
          - regionId
          - '{{ ACS::TaskLoopItem }}'
      instanceId:
        'Fn::Select':
          - instanceId
          - '{{ ACS::TaskLoopItem }}'
      commandContent: '{{ commandContent }}'
      commandType: '{{ commandType }}'
      timeout: '{{ timeout }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ instanceInfos }}'
      Outputs:
        commandOutputs:
          AggregateType: Fn::ListJoin
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: invocationOutput
Outputs:
  commandOutputs:
    Type: List
    Value: '{{ runCommand.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - instanceInfos
          - commandType
          - commandContent
          - timeout
        Label:
          default:
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            en: Control Options