All Products
Search
Document Center

CloudOps Orchestration Service:ACS-CS-BulkyEnableDeletionProtection

Last Updated:Nov 22, 2024

Template name

ACS-CS-BulkyEnableDeletionProtection

Execute Now

Template description

Enables deletion protection for clusters.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

clusterIds

The IDs of the clusters.

List

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

rateControl

The rate control settings.

Json

No

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

OOSAssumeRole

The RAM role that is assumed by CloudOps Orchestration Service (OOS).

String

No

""

Output parameters

None

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "cs:ModifyCluster"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

References

For more information, see ACS-CS-BulkyEnableDeletionProtection.yml at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Enable deletion protection for the cluster
   
  name-en: ACS-CS-BulkyEnableDeletionProtection
   
  categories:
    - security
Parameters:
  regionId:
    Label:
      en: RegionId
       
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  clusterIds:
    Label:
      en: Cluster Ids
       
    Type: List
  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: modifyCluster
    Action: ACS::ExecuteAPI
    Properties:
      Service: CS
      API: ModifyCluster
      Method: PUT
      URI: /api/v2/clusters/{{ ACS::TaskLoopItem }}
      Parameters: null
      Body: '{"deletion_protection":true}'
    Description:
      en: Executes a command in cluster
       
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ clusterIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - clusterIds
          - regionId
        Label:
          default:
             
            en: Configure Parameters
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
             
            en: Control Options