テンプレート名
ACS-ECS-BulkyRunCommandInSLBVServerGroup:SLB 仮想サーバーグループ内の ECS インスタンスに対してコマンドをバッチ実行します。
テンプレートの説明
SLB 仮想サーバーグループ内の ECS インスタンスに対してコマンドをバッチ実行します。
テンプレートタイプ
オートメーション
所有者
Alibaba Cloud
入力パラメーター
|
パラメーター名 |
説明 |
タイプ |
必須 |
デフォルト値 |
制約 |
|
VServerGroupId |
VServer グループ ID。 |
String |
必須 |
||
|
commandType |
Cloud Assistant コマンドのタイプ。 |
String |
いいえ |
RunShellScript |
|
|
commandContent |
ECS インスタンスで実行する Cloud Assistant コマンドの内容。 |
String |
いいえ |
echo hello |
|
|
rateControl |
タスクの同時実行レート。 |
JSON |
いいえ |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 1} |
|
|
OOSAssumeRole |
OOS が引き受ける RAM ロール。 |
String |
いいえ |
"" |
出力パラメーター
|
パラメーター名 |
説明 |
タイプ |
|
commandOutputs |
List |
このテンプレートに必要なアクセスポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"slb:DescribeVServerGroupAttribute",
"slb:SetVServerGroupAttribute"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
ACS-ECS-BulkyRunCommandInSLBVServerGroup の詳細
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: Bulky run command on ECS instances of VServer group
zh-cn: 在 SLB VServer 组中的 ECS 实例上批量运行命令
name-en: ACS-ECS-BulkyRunCommandInSLBVServerGroup
name-zh-cn: 在 SLB VServer 组中的 ECS 实例上批量运行命令
categories:
- slb_management
Parameters:
VServerGroupId:
Label:
en: VServerGroupId
zh-cn: VServer 组 ID
Type: String
commandType:
Label:
en: CommandType
zh-cn: 命令类型
Type: String
AllowedValues:
- RunBatScript
- RunPowerShellScript
- RunShellScript
Default: RunShellScript
commandContent:
Label:
en: CommandContent
zh-cn: 命令内容
Type: String
AssociationProperty: Code
Default: echo hello
rateControl:
Label:
en: RateControl
zh-cn: 任务并发率
Type: JSON
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 1
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS 扮演的 RAM 角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: describeVServerGroupAttribute
Action: ACS::ExecuteApi
Description:
en: Views vserver group attribute
zh-cn: 查看 VServer 组属性
Properties:
Service: SLB
API: DescribeVServerGroupAttribute
Parameters:
VServerGroupId: '{{ VServerGroupId }}'
Outputs:
BackendServers:
Type: List
ValueSelector: BackendServers.BackendServer[]
- Name: runCommand
Action: ACS::ECS::ElegantRunCommandInSLBVServerGroup
Description:
en: Execute cloud assistant command
zh-cn: 执行 Cloud Assistant 命令
Properties:
VServerGroupId: '{{ VServerGroupId }}'
commandContent: '{{ commandContent }}'
commandType: '{{ commandType }}'
serverId:
'Fn::Select':
- ServerId
- '{{ ACS::TaskLoopItem }}'
weight:
'Fn::Select':
- Weight
- '{{ ACS::TaskLoopItem }}'
type:
'Fn::Select':
- Type
- '{{ ACS::TaskLoopItem }}'
port:
'Fn::Select':
- Port
- '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ describeVServerGroupAttribute.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:
- VServerGroupId
- commandType
- commandContent
Label:
default:
zh-cn: 配置参数
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高级设置
en: Control