すべてのプロダクト
Search
ドキュメントセンター

CloudOps Orchestration Service:カスタマーマスターキー ( CMK ) の削除保護を一括設定

最終更新日:Jan 17, 2025

テンプレート名

ACS-KMS-BulkySetDeletionProtection

今すぐ実行

テンプレートの説明

カスタマーマスターキー ( CMK ) の削除保護を有効にします。

テンプレートの種類

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

種類

必須

デフォルト値

制限

keyId

キー ID 。

String

はい

regionId

リージョン ID 。

String

いいえ

{{ ACS::RegionId }}

rateControl

レート制御設定。

Json

いいえ

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}

OOSAssumeRole

CloudOps Orchestration Service ( OOS ) によって引き受けられる RAM ロール。

String

いいえ

""

出力パラメーター

なし

テンプレートを実行するために必要な権限ポリシー

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "kms:DescribeKey",
                "kms:SetDeletionProtection"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

参照

詳細については、GitHub の ACS-KMS-BulkySetDeletionProtection.yml をご参照ください。

テンプレートの内容

FormatVersion: OOS-2019-06-01
Description:
  en: Enable deletion protection for CMK
   
  name-en: ACS-KMS-BulkySetDeletionProtection
   
  categories:
    - security
Parameters:
  regionId:
    Label:
      en: RegionId
       
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  keyId:
    Label:
      en: The ids of key
       
    Type: String
  rateControl:
    Label:
      en: RateControl
       
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
       
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: describeKey
    Action: ACS::ExecuteAPI
    Description:
      en: Query the arn of key
       
    Properties:
      Service: KMS
      API: DescribeKey
      Parameters:
        RegionId: '{{ regionId }}'
        KeyId: '{{ keyId }}'
    Outputs:
      arn:
        Type: List
        ValueSelector: '.KeyMetadata.Arn'
  - Name: setDeletionProtection
    Action: ACS::ExecuteAPI
    Description:
      en: Enable deletion protection for CMK.
       
    Properties:
      Service: KMS
      API: SetDeletionProtection
      Parameters:
        RegionId: '{{ regionId }}'
        ProtectedResourceArn: '{{ ACS::TaskLoopItem }}'
        EnableDeletionProtection: true
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ describeKey.arn }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - keyId
        Label:
          default:
             
            en: Select KMS Key
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
             
            en: Control Options