Nama templat
ACS-ECS-BulkyRunCommandInSLBVServerGroup: Menjalankan perintah secara batch pada instance ECS dalam grup server virtual SLB.
Deskripsi templat
Menjalankan perintah secara batch pada instance ECS dalam grup server virtual SLB.
Jenis templat
Automation
Pemilik
Alibaba Cloud
Parameter input
|
Nama parameter |
Deskripsi |
Tipe |
Wajib |
Nilai default |
Batasan |
|
VServerGroupId |
ID grup server. |
String |
Ya |
||
|
commandType |
Tipe perintah Cloud Assistant. |
String |
Tidak |
RunShellScript |
|
|
commandContent |
Perintah Cloud Assistant yang akan dijalankan pada instance ECS. |
String |
Tidak |
echo hello |
|
|
rateControl |
Laju konkurensi untuk eksekusi tugas. |
Json |
Tidak |
{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 1} |
|
|
OOSAssumeRole |
Peran RAM yang diasumsikan oleh OOS. |
String |
Tidak |
“” |
Parameter output
|
Nama parameter |
Deskripsi |
Tipe |
|
commandOutputs |
List |
Kebijakan akses yang diperlukan untuk templat ini
{
"Version": "1",
"Statement": [
{
"Action": [
"slb:DescribeVServerGroupAttribute",
"slb:SetVServerGroupAttribute"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Detail ACS-ECS-BulkyRunCommandInSLBVServerGroup
Konten templat
FormatVersion: OOS-2019-06-01
Description:
en: Bulky run command on ECS instances of VServer group
zh-cn: Runs commands in a batch on ECS instances in an SLB virtual server group.
name-en: ACS-ECS-BulkyRunCommandInSLBVServerGroup
name-zh-cn: Runs commands in a batch on ECS instances in an SLB virtual server group.
categories:
- slb_management
Parameters:
VServerGroupId:
Label:
en: VServerGroupId
zh-cn: The ID of the server group.
Type: String
commandType:
Label:
en: CommandType
zh-cn: The type of the Cloud Assistant command.
Type: String
AllowedValues:
- RunBatScript
- RunPowerShellScript
- RunShellScript
Default: RunShellScript
commandContent:
Label:
en: CommandContent
zh-cn: The Cloud Assistant command to run on the ECS instances.
Type: String
AssociationProperty: Code
Default: echo hello
rateControl:
Label:
en: RateControl
zh-cn: The concurrency rate for the task execution.
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 1
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role that OOS assumes.
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: describeVServerGroupAttribute
Action: ACS::ExecuteApi
Description:
en: Views vserver group attribute
zh-cn: Views the attributes of the service group.
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: Executes the Cloud Assistant command.
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: Configure Parameters
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Control
en: Control