テンプレート名
ACS-ECS-BulkyDetachKeyPairOnline:実行中のインスタンスからキーペアをバッチでデタッチ
テンプレートの説明
Linux インスタンスを再起動する必要なく、一度に複数の Linux Elastic Compute Service (ECS) インスタンスからキーペアをデタッチします。
テンプレートの種類
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | 種類 | 必須 | デフォルト値 | 制限 |
targets | ターゲットインスタンス | Json | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
rateControl | タスク実行の同時実行率 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) によって引き受けられる Resource Access Management (RAM) ロール。 | String | いいえ | "" |
出力パラメーター
なし
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:DescribeKeyPairs",
"ecs:DetachKeyPair",
"ecs:InvokeCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-ECS-BulkyDetachKeyPairOnline.yml をご参照ください。
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: Bulky detach key pair from Linux instances without reboot
zh-cn: Batch detach key pairs from multiple Linux instances without a restart.
name-en: Detach Key Pair Online
name-zh-cn: Detach Key Pair Online
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: Target Instance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: resourceType
RegionId: regionId
Status: Running
rateControl:
Label:
en: RateControl
zh-cn: Concurrency rate for task execution
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role that OOS assumes
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: Retrieves ECS instances
Action: ACS::SelectTargets
Properties:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: detachKeyPairOnline
Action: ACS::ECS::DetachKeyPairOnline
Description:
en: Detach Key Pair Online
zh-cn: Detaches the key pair online
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Configuration Parameters
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Control Options