All Products
Search
Document Center

CloudOps Orchestration Service:ACS-Redis-BulkyCreateBackupAndUploadToOSS

Last Updated:Dec 25, 2024

Template name

ACS-Redis-BulkyCreateBackupAndUploadToOSS

Execute Now

Template description

Creates backups of multiple Tair (Redis OSS-compatible) instances and uploads the backups to an Object Storage Service (OSS) bucket at a time. You may be charged for backing up Tair (Redis OSS-compatible) instances and uploading backups to OSS by using Function Compute (FC). For more information, see Automatic or manual backup and Billing overview.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Data type

Required

Default value

Limit

targets

The destination instances.

Json

Yes

OSSRegionId

The region where the OSS bucket resides.

String

Yes

OSSBucketName

The name of the OSS bucket.

String

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

Parameter

Description

Data type

OSSObjectURLs

List

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "kvstore:CreateBackup",
                "kvstore:DescribeBackupTasks",
                "kvstore:DescribeBackups",
                "kvstore:DescribeInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ros:CreateStack",
                "ros:DeleteStack",
                "ros:GetStack"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

References

ACS-Redis-BulkyCreateBackupAndUploadToOSS

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Create Redis backups in batches and upload them to OSS. Backing up redis and using fc to upload the backup to OSS may incur charges. For billing details, please refer to <a href='https://www.alibabacloud.com/help/en/redis/user-guide/automatic-or-manual-backup?spm=a2c63.p38356.help-menu-26340.d_2_9_0.321175a7z6rJtK'>Redis Backup Fee Instructions</a> and <a href='https://www.alibabacloud.com/help/en/functioncompute/fc-2-0/product-overview/billing-overview?spm=a2c63.p38356.help-menu-2508973.d_0_3_0.4a00398e6YSvsZ'>Function calculation billing instructions</a>
  name-en: ACS-Redis-BulkyCreateBackupAndUploadToOSS
Parameters:
  regionId:
    Label:
      en: RegionId     
    Type: String
    AssociationProperty: RegionId
    Default: '{{ACS::RegionId}}'
  targets:
    Type: Json
    Label:
      en: TargetInstance      
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::Redis::Instance
      RegionId: regionId
  OSSRegionId:
    Label:
      en: OSSRegionId       
    Type: String
    AssociationProperty: RegionId
  OSSBucketName:
    Label:
      en: OSSBucketName       
    Type: String
    AssociationProperty: ALIYUN::OSS::Bucket::BucketName
    AssociationPropertyMetadata:
      RegionId: ${OSSRegionId}
  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: GetInstance
    Description:
      en: Get the redis instances      
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::Redis::Instance
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      InstanceIds:
        Type: List
        ValueSelector: Instances.Instance[].InstanceId
  - Name: CreateBackupAndUploadToOSS
    Action: ACS::Redis::CreateBackupAndUploadToOSS
    Description:
      en: Create backup and upload to OSS       
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      OSSRegionId: '{{ OSSRegionId }}'
      OSSBucketName: '{{ OSSBucketName }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ GetInstance.InstanceIds }}'
      Outputs:
        OSSObjectURLs:
          AggregateType: Fn::ListJoin
          AggregateField: OSSObjectURL
    Outputs:
      OSSObjectURL:
        Type: String
        ValueSelector: '.OSSObjectURL + "{{ACS::ExecutionId}}/"  | split(".t0") | .[0]'
Outputs:
  OSSObjectURLs:
    Type: List
    Value: '{{ CreateBackupAndUploadToOSS.OSSObjectURLs }}'