すべてのプロダクト
Search
ドキュメントセンター

CloudOps Orchestration Service:ACS-ECS-BulkyRunCommandInSLBDefaultServerGroup

最終更新日:Jun 23, 2026

テンプレート名

ACS-ECS-BulkyRunCommandInSLBDefaultServerGroup: SLB インスタンスのデフォルトサーバーグループ内の ECS インスタンスで、コマンドをバッチで実行します。

今すぐ実行

説明

SLB インスタンスのデフォルトサーバーグループ内の ECS インスタンスで、コマンドをバッチで実行します。

テンプレートのタイプ

オートメーション

所有者

Alibaba Cloud

入力パラメーター

パラメーター名

説明

タイプ

必須

デフォルト値

制約

loadBalancerId

SLB インスタンスの ID。

String

はい

commandType

クラウドアシスタントコマンドのタイプ。

String

いいえ

RunShellScript

commandContent

ECS インスタンスで実行するクラウドアシスタントコマンド。

String

いいえ

echo hello

rateControl

タスク実行の同時実行レート。

Json

いいえ

{ 'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 1 }

OOSAssumeRole

OOS が引き受ける RAM ロール。

String

いいえ

""

出力パラメーター

パラメーター名

説明

タイプ

commandOutputs

List

このテンプレートの実行に必要な権限

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

詳細

ACS-ECS-BulkyRunCommandInSLBDefaultServerGroup の詳細

テンプレートの内容

FormatVersion: OOS-2019-06-01
Description:
  ja: SLB インスタンスのデフォルトサーバーグループ内の ECS インスタンスで、コマンドをバッチで実行します。
  name-ja: ACS-ECS-BulkyRunCommandInSLBDefaultServerGroup
  categories:
    - slb_management
Parameters:
  loadBalancerId:
    Label:
      ja: SLB インスタンス ID
    Type: String
  commandType:
    Label:
      ja: クラウドアシスタントコマンドのタイプ
    Type: String
    AllowedValues:
      - RunBatScript
      - RunPowerShellScript
      - RunShellScript
    Default: RunShellScript
  commandContent:
    Label:
      ja: ECS インスタンスで実行するクラウドアシスタントコマンド
    Type: String
    AssociationProperty: Code
    Default: echo hello
  rateControl:
    Label:
      ja: タスク実行の同時実行レート
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 1
  OOSAssumeRole:
    Label:
      ja: OOS が引き受ける RAM ロール
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeLoadBalancerAttribute
    Action: ACS::ExecuteApi
    Description:
      ja: SLB インスタンスのデフォルトサーバーグループの属性を取得します。
    Properties:
      Service: SLB
      API: DescribeLoadBalancerAttribute
      Parameters:
        LoadBalancerId: '{{ loadBalancerId }}'
    Outputs:
      BackendServers:
        Type: List
        ValueSelector: BackendServers.BackendServer[]
      port:
        Type: Number
        ValueSelector: ListenerPorts.ListenerPort[]
  - Name: runCommand
    Action: ACS::ECS::ElegantRunCommandInSLBDefaultServerGroup
    Description:
      ja: クラウドアシスタントコマンドを実行します。
    Properties:
      loadBalancerId: '{{ loadBalancerId }}'
      commandContent: '{{ commandContent }}'
      commandType: '{{ commandType }}'
      serverId:
        'Fn::Select':
          - ServerId
          - '{{ ACS::TaskLoopItem }}'
      weight:
        'Fn::Select':
          - Weight
          - '{{ ACS::TaskLoopItem }}'
      type:
        'Fn::Select':
          - Type
          - '{{ ACS::TaskLoopItem }}'
      port: '{{ describeLoadBalancerAttribute.port }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ describeLoadBalancerAttribute.BackendServers }}'
      Outputs:
        commandOutputs:
          AggregateType: Fn::ListJoin
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  commandOutputs:
    Type: List
    Value: '{{ runCommand.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - loadBalancerId
          - commandType
          - commandContent
        Label:
          default:
            ja: パラメーターの設定
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            ja: 詳細オプション