ACS-ECS-JoinSecurityGroupToMultipleInstance
更新時(shí)間:
模板名稱
ACS-ECS-JoinSecurityGroupToMultipleInstance 下發(fā)安全組至多臺(tái)實(shí)例
模板描述
將安全組下發(fā)至多臺(tái)實(shí)例
模板類型
自動(dòng)化
所有者
Alibaba Cloud
輸入?yún)?shù)
參數(shù)名稱 | 描述 | 類型 | 是否必填 | 默認(rèn)值 | 約束 |
targets | 目標(biāo)實(shí)例 | Json | 是 | ||
securityGroupId | 需下發(fā)的安全組ID | String | 是 | ||
regionId | 地域ID | String | 否 | {{ ACS::RegionId }} | |
rateControl | 任務(wù)執(zhí)行的并發(fā)比率 | Json | 否 | {‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10} | |
OOSAssumeRole | OOS扮演的RAM角色 | String | 否 | “” |
輸出參數(shù)
無
執(zhí)行此模板需要的權(quán)限策略
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:JoinSecurityGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳情
ACS-ECS-JoinSecurityGroupToMultipleInstance詳情
模板內(nèi)容
FormatVersion: OOS-2019-06-01
Description:
en: Join a security group to multiple instances
zh-cn: 將安全組下發(fā)至多臺(tái)實(shí)例
name-en: ACS-ECS-JoinSecurityGroupToMultipleInstance
name-zh-cn: 下發(fā)安全組至多臺(tái)實(shí)例
categories:
- instance_manage
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: 目標(biāo)實(shí)例
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
securityGroupId:
Label:
en: SecurityGroupId
zh-cn: 需下發(fā)的安全組ID
Type: String
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
RegionId: regionId
rateControl:
Label:
en: RateControl
zh-cn: 任務(wù)執(zhí)行的并發(fā)比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: 獲取ECS實(shí)例
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: checkInstanceReady
Action: ACS::CheckFor
Description:
en: Checks whether the ECS instance status is running or stopped
zh-cn: 檢查實(shí)例狀態(tài)在Running或者Stopped
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ ACS::TaskLoopItem }}'
DesiredValues:
- Running
- Stopped
PropertySelector: Instances.Instance[].Status
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
- Name: joinSecurityGroup
Action: 'ACS::ExecuteAPI'
Description:
en: Deliver a security group to a specified ECS instance
zh-cn: 將安全組下發(fā)到指定的ECS實(shí)例上
Properties:
Service: ECS
API: JoinSecurityGroup
Parameters:
SecurityGroupId: '{{ securityGroupId }}'
InstanceId: '{{ ACS::TaskLoopItem }}'
RegionId: '{{ regionId }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- securityGroupId
Label:
default:
zh-cn: 選擇安全組
en: Select Security Group
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: 選擇實(shí)例
en: Select Ecs Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高級(jí)選項(xiàng)
en: Control Options
文檔內(nèi)容是否對(duì)您有幫助?