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

CloudOps Orchestration Service:ACS-ECS-ApproveBulkyRunCommand

最終更新日:Dec 21, 2025

テンプレート名

ACS-ECS-ApproveBulkyRunCommand:承認後にコマンドをバッチで実行

今すぐ実行

テンプレートの説明

承認後、複数の Elastic Compute Service (ECS) インスタンスで一度にコマンドを実行します。

テンプレートタイプ

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

タイプ

必須

デフォルト値

制限

targets

ターゲットインスタンス

Json

はい

commandContent

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

String

はい

webHookUrl

DingTalk チャットボットの Webhook URL。

String

はい

atMobiles

指定された DingTalk グループで承認通知が送信されるユーザー。

List

はい

approvers

O&M タスクを承認または拒否できるユーザー。

List

はい

regionId

リージョン ID。

String

いいえ

{{ ACS::RegionId }}

commandType

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

String

いいえ

RunShellScript

rateControl

タスク実行の同時実行数

Json

いいえ

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

atAll

指定された DingTalk グループに承認通知が送信されたときに、すべてのグループメンバーに通知するかどうかを指定します。

String

いいえ

false

minRequiredApprovals

O&M タスクの承認に必要な承認者の最小数。

Number

いいえ

1

OOSAssumeRole

CloudOps Orchestration Service (OOS) によって引き受けられる Resource Access Management (RAM) ロール。

String

いいえ

""

出力パラメーター

パラメーター

説明

タイプ

commandOutputs

List

テンプレートの実行に必要な権限ポリシー

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

詳細

詳細については、GitHub の ACS-ECS-ApproveBulkyRunCommand.yml をご参照ください。

テンプレートコンテンツ

FormatVersion: OOS-2019-06-01
Description:
  en: Approve Bulky RunCommand
  zh-cn: 承認後にコマンドをバッチで実行
  ja: 承認後にコマンドを一括実行
  name-en: ACS-ECS-ApproveBulkyRunCommand
  name-zh-cn: 承認後にコマンドをバッチで実行
  name-ja: ACS-ECS-ApproveBulkyRunCommand
  categories:
    - instance_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: リージョン ID
      ja: リージョン ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Label:
      en: TargetInstance
      zh-cn: ターゲットインスタンス
      ja: ターゲットインスタンス
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  commandType:
    Label:
      en: CommandType
      zh-cn: クラウドアシスタントコマンドのタイプ
      ja: クラウドアシスタントコマンドのタイプ
    Type: String
    AllowedValues:
      - RunBatScript
      - RunPowerShellScript
      - RunShellScript
    Default: RunShellScript
  commandContent:
    Label:
      en: CommandContent
      zh-cn: ECS インスタンスで実行するクラウドアシスタントコマンド
      ja: コマンド内容
    Type: String
    AssociationProperty: Code
  rateControl:
    Label:
      en: RateControl
      zh-cn: タスク実行の同時実行レート
      ja: レート制御
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  webHookUrl:
    Label:
      en: WebHookUrl
      zh-cn: DingTalk グループアシスタントの Webhook URL
      ja: Webhook URL
    Description:
      en: >-
        e.g.https://oapi.dingtalk.com/robot/send?access_token=1234zxcvaksdq31414,acquiring DingTalk webhook please refer to second appendix in https://www.alibabacloud.com/help/document_detail/144679.html.
      zh-cn: >-
        例:https://oapi.dingtalk.com/robot/send?access_token=1234zxcvaksdq31414。DingTalk Webhook の取得方法の詳細については、https://www.alibabacloud.com/help/document_detail/144679.html#h2--2-webhook-5 をご参照ください。
      ja: >-
        例:https://oapi.dingtalk.com/robot/send?access_token=1234zxcvaksdq31414。DingTalk Webhook の取得方法については、https://www.alibabacloud.com/help/document_detail/144679.html#h2--2-webhook-5 をご参照ください。
    Type: String
  atMobiles:
    Label:
      en: AtMobiles
      zh-cn: 承認通知で @ メンションするグループメンバーの DingTalk 携帯電話番号
      ja: @メンションする携帯電話番号
    Type: List
  atAll:
    Label:
      en: AtAll
      zh-cn: グループアシスタントが DingTalk グループに承認通知を送信するときに、@all メンバーを指定するかどうか
      ja: 全員に@メンション
    Type: String
    Default: 'false'
  approvers:
    Label:
      en: Approvers
      zh-cn: タスクを承認できるユーザー
      ja: 承認者
    Description:
      en: The name to fill is the front part of @ in the RAM user name,if  RAM user is user001@companyAlias.onaliyun.com, then fill  user001  in list.
      zh-cn: >-
        ユーザー名は、RAM ユーザー名のアットマーク (@) より前の部分です。たとえば、RAM ユーザーが user001@companyAlias.onaliyun.com の場合、リストに user001 と入力します。
      ja: >-
        入力するユーザー名は、RAM ユーザー名の @ 記号より前の部分です。たとえば、RAM ユーザーが user001@companyAlias.onaliyun.com の場合、リストに user001 と入力します。
    Type: List
    AssociationProperty: ALIYUN::RAM::User
  minRequiredApprovals:
    Label:
      en: MinRequiredApprovals
      zh-cn: 必要な承認の最小数
      ja: 必要な承認の最小数
    Type: Number
    Default: 1
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS が偽装する RAM ロール
      ja: OOS が偽装する RAM ロール
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: approveBulkyRuncommand
    Action: 'ACS::Approve'
    Description:
      en: Approve operation task runcommand
      zh-cn: O&M タスクを承認
      ja: runcommand 操作タスクを承認
    Properties:
      Approvers: '{{approvers}}'
      MinRequiredApprovals: '{{minRequiredApprovals}}'
      NotifyType: WebHook
      WebHook:
        URI: '{{webhookUrl}}'
        Headers:
          Content-Type: application/json
        Content:
          msgtype: text
          text:
            content: >-
              Notify: Please approve the task execution to create ECS instance sent by
              {{ACS::RegionId}} oos {{ACS::ExecutionId}} .
          at:
            atMobiles: '{{atMobiles}}'
            isAtAll: '{{atAll}}'

  - Name: bulkyRunCommand
    Action: ACS::Template
    Description:
      en: Execute cloud assistant command
      zh-cn: クラウドアシスタントコマンドを実行
      ja: クラウドアシスタントコマンドを実行
    Properties:
      TemplateName: ACS-ECS-BulkyRunCommand
      Parameters:
        regionId: '{{ regionId }}'
        commandContent: '{{ commandContent }}'
        commandType: '{{ commandType }}'
        targets: '{{ targets }}'
        rateControl: '{{ rateControl }}'
    Outputs:
      commandOutputs:
        Type: List
        ValueSelector: commandOutputs
Outputs:
  commandOutputs:
    Type: List
    Value: '{{ bulkyRunCommand.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - webHookUrl
          - atMobiles
          - atAll
          - approvers
          - minRequiredApprovals
        Label:
          default:
            zh-cn: 承認の設定
            en: Configure Approval
            ja: 承認の設定
      - Parameters:
          - commandType
          - commandContent
        Label:
          default:
            zh-cn: コマンドの設定
            en: Configure Command
            ja: コマンドの設定
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: インスタンスの選択
            en: Select Instances
            ja: インスタンスの選択
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 詳細オプション
            en: Control Options
            ja: 制御オプション