ACS-VPC-BulkyEnableDeletionProtection

更新时间:
复制 MD 格式

Enable deletion protection for multiple VPCs in bulk through an automated OOS template.

Template name

ACS-VPC-BulkyEnableDeletionProtection

Execute Now

Template description

Enables deletion protection for multiple virtual private clouds (VPCs) at a time.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

instanceIds

The IDs of the VPCs.

List

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

type

The instance type for which to enable deletion protection.

String

No

NATGW

protectionEnable

Whether to enable deletion protection.

Boolean

No

True

rateControl

The rate control settings.

Json

No

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

OOSAssumeRole

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

String

No

""

Output parameters

None

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "vpc:DeletionProtection"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

References

For more information, see ACS-VPC-BulkyEnableDeletionProtection at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky enable deletion protection for instances
  name-en: ACS-VPC-BulkyEnableDeletionProtection
  categories:
    - security
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  type:
    Label:
      en: Type
    Type: String
    AllowedValues:
      - EIP
      - CBWP
      - NATGW
    Default: NATGW
  instanceIds:
    Label:
      en: InstanceIds
    Type: List
  protectionEnable:
    Label:
      en: ProtectionEnable
    Type: Boolean
    Default: true
  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: enableDeletionProtection
    Action: 'ACS::ExecuteApi'
    Description:
      en: Enables deletion protection for an instance
    Properties:
      Service: VPC
      API: DeletionProtection
      Parameters:
        RegionId: '{{ regionId }}'
        Type: '{{ type }}'
        InstanceId: '{{ ACS::TaskLoopItem }}'
        ProtectionEnable: '{{ protectionEnable }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ instanceIds }}'