テンプレート名
ACS-ECS-BulkyEnableDeletionProtection:インスタンスの削除保護をバッチで有効化
テンプレートの説明
複数の 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:ModifyInstanceAttribute"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-ECS-BulkyEnableDeletionProtection.yml をご参照ください。
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: Enables deletion protection for instances in batches.
name-en: ACS-ECS-BulkyEnableDeletionProtection
categories:
- security
Parameters:
regionId:
Type: String
Label:
en: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: Target Instance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: Rate Control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: RAM Role for OOS
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Retrieves the specified ECS instances.
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: enableInstanceDeletionProtection
Action: ACS::ECS::EnableInstanceDeletionProtection
Description:
en: Enables deletion protection for the instance.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
deletionProtection: true
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- targets
Label:
default:
en: Select Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced Options