All Products
Search
Document Center

CloudOps Orchestration Service:ACS-Mongodb-BulkyModifyBackupPolicy

Last Updated:Dec 20, 2025

Template name

ACS-Mongodb-BulkyModifyBackupPolicy Modifies the backup policies of MongoDB instances

Execute Now

Template description

Modifies the backup policy of ApsaraDB for MongoDB instances.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Data type

Required

Default value

Limit

preferredBackupPeriod

The backup cycle.

List

Yes

OOSAssumeRole

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

String

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

targets

Concurrent task execution rate

Json

No

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

instanceIds

The IDs of the instances.

List

No

[]

preferredBackupTime

Backup start time

String

No

03:00Z-04:00Z

rateControl

The rate control settings.

Json

No

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

Output parameters

N/A.

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "dds:DescribeDBInstances",
                "dds:ModifyBackupPolicy"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Details

ACS-Mongodb-BulkyModifyBackupPolicy

Template content

FormatVersion: OOS-2019-06-01
Description:
  name-en: ACS-Mongodb-BulkyModifyBackupPolicy
  name-zh-cn: Modifies the backup policy of MongoDB instances
  en: Modifies the backup policy of MongoDB instances.
  zh-cn: Modifies the backup policy of MongoDB instances.
  categories:
    - mongodb
Parameters:
  regionId:
    Label:
      en: Region ID
      zh-cn: Region ID
    Description:
      en: The ID of the region.
      zh-cn: The ID of the region.
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: Target Instance
      zh-cn: Target Instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::MongoDB::Instance
      RegionId: regionId
    Default:
      Type: ResourceIds
      ResourceIds: []
      RegionId: '{{ regionId }}'
  instanceIds:
    Label:
      en: Instance IDs
      zh-cn: Instance IDs
    Description:
      en: The IDs of the instances.
      zh-cn: The IDs of the instances.
    Type: List
    Default: []
    AssociationPropertyMetadata:
      Visible:
        Condition:
          Fn::Equals:
            - ${targets}
            - {}
  preferredBackupTime:
    Label:
      en: Preferred Backup Time
      zh-cn: Preferred Backup Time
    Description:
      en: The time to perform backups. The time must be in UTC. The format is HH:mmZ-HH:mmZ. The time range must be one hour.
      zh-cn: The time to perform backups. The time must be in UTC. The format is HH:mmZ-HH:mmZ. The time range must be one hour.
    Type: String
    Default: 03:00Z-04:00Z
  preferredBackupPeriod:
    Label:
      en: Preferred Backup Cycle
      zh-cn: Preferred Backup Cycle
    Description:
      en: The backup cycle.
      zh-cn: The backup cycle.
    Type: List
    AllowedValues:
      - Monday
      - Tuesday
      - Wednesday
      - Thursday
      - Friday
      - Saturday
      - Sunday
  rateControl:
    Label:
      en: Rate Control
      zh-cn: Rate Control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOSAssumeRole
    Type: String
RamRole: '{{ OOSAssumeRole }}'
Conditions:
  instanceId:
    Fn::Equals:
      - '{{ instanceIds }}'
      - []
Tasks:
  - Name: getInstance
    When: instanceId
    Description:
      en: Obtains the MongoDB instances.
      zh-cn: Obtains the MongoDB instances.
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::MongoDB::Instance
      Filters:
        - '{{ targets }}'
      RegionId: '{{regionId}}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: Instances.Instance[].InstanceId
  - Name: ModifyBackupPolicy
    Action: ACS::ExecuteAPI
    Description:
      en: Modifies the backup policy of the MongoDB instances.
      zh-cn: Modifies the backup policy of the MongoDB instances.
    Properties:
      Service: dds
      API: ModifyBackupPolicy
      Parameters:
        RegionId: '{{ regionId }}'
        DBInstanceId: '{{ ACS::TaskLoopItem }}'
        PreferredBackupTime: '{{ preferredBackupTime }}'
        PreferredBackupPeriod:
          Fn::Join:
            - ','
            - '{{ preferredBackupPeriod }}'
        BackupRetentionPeriod: 30
        EnableBackupLog: 1
        LogBackupRetentionPeriod: 30
        SnapshotBackupType: Standard
        BackupInterval: -1
    Loop:
      Items:
        Fn::If:
          - Fn::Equals:
              - '{{instanceIds}}'
              - []
          - '{{ getInstance.instanceIds }}'
          - '{{ instanceIds}}'
      RateControl: '{{ rateControl }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - instanceIds
          - targets
        Label:
          default:
            zh-cn: Select instances
            en: Select instances
      - Parameters:
          - preferredBackupTime
          - preferredBackupPeriod
        Label:
          default:
            zh-cn: Configure backup policy
            en: Configure backup policy
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options
            en: Advanced options