全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-Redis-BulkyCreateBackupAndUploadToOSS

更新時間:Dec 20, 2025

模板名稱

ACS-Redis-BulkyCreateBackupAndUploadToOSS 大量建立Redis備份並上傳到OSS

立即執行

模板描述

大量建立Redis備份並上傳到OSS。備份redis和使用fc將備份上傳到oss都可能會產生費用,計費詳情參考Redis備份費用說明Function Compute計費說明

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

targets

目標執行個體

Json

OSSRegionId

OSS Bucket所在地區ID

String

OSSBucketName

OSS Bucket名稱

String

regionId

地區ID

String

{{ACS::RegionId}}

invokeConfig

執行配置

String

sync

rateControl

任務執行的並發比率

Json

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

OOSAssumeRole

OOS扮演的RAM角色

String

""

輸出參數

參數名稱

描述

類型

OSSObjectURLs

List

執行此模板需要的權限原則

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "kvstore:CreateBackup",
                "kvstore:DescribeBackupTasks",
                "kvstore:DescribeBackups",
                "kvstore:DescribeInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ros:CreateStack",
                "ros:DeleteStack",
                "ros:GetStack"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ecs:DescribeNetworkInterfaces"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "fc:CreateFunction",
                "fc:CreateService",
                "fc:CreateVpcBinding",
                "fc:DeleteFunction",
                "fc:DeleteFunctionAsyncInvokeConfig",
                "fc:DeleteService",
                "fc:DeleteVpcBinding",
                "fc:GetFunction",
                "fc:GetResourceTags",
                "fc:GetService",
                "fc:GetStatefulAsyncInvocation",
                "fc:InvokeFunction",
                "fc:PutFunctionAsyncInvokeConfig",
                "fc:TagResource",
                "fc:UnTagResource",
                "fc:UpdateFunction",
                "fc:UpdateService"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ram:PassRole"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-Redis-BulkyCreateBackupAndUploadToOSS詳情

模板內容

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://help .aliyun.com/zh/redis/user-guide/automatic-or-manual-backup#e606eb29c7mew'>Redis Backup Fee Instructions</a> and <a href='https://www.alibabacloud.com/help/zh/ fc/product-overview/billing-overview'>Function calculation billing instructions</a>
  zh-cn: 大量建立Redis備份並上傳到OSS。備份redis和使用fc將備份上傳到oss都可能會產生費用,計費詳情參考<a href='https://www.alibabacloud.com/help/zh/redis/user-guide/automatic-or-manual-backup#e606eb29c7mew'>Redis備份費用說明</a>和<a href='https://www.alibabacloud.com/help/zh/fc/product-overview/billing-overview'>Function Compute計費說明</a>
  name-en: ACS-Redis-BulkyCreateBackupAndUploadToOSS
  name-zh-cn: 大量建立Redis備份並上傳到OSS
  categories:
    - tair
Parameters:
  regionId:
    Label:
      en: RegionId
      zh-cn: 地區ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ACS::RegionId}}'
  targets:
    Type: Json
    Label:
      en: TargetInstance
      zh-cn: 目標執行個體
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::Redis::Instance
      RegionId: regionId
  OSSRegionId:
    Label:
      en: OSSRegionId
      zh-cn: OSS Bucket所在地區ID
    Type: String
    AssociationProperty: RegionId
  OSSBucketName:
    Label:
      en: OSSBucketName
      zh-cn: OSS Bucket名稱
    Type: String
    AssociationProperty: ALIYUN::OSS::Bucket::BucketName
    AssociationPropertyMetadata:
      RegionId: ${OSSRegionId}
  invokeConfig:
    Type: String
    Label:
      en: Invoke Config
      zh-cn: 執行配置
    Description:
      en: 'FC function execution configuration: synchronous execution or asynchronous execution When using FC to upload a backup, if your backup file is large, the backup upload may fail due to the 60s running time limit of FC synchronous execution. It is recommended that you choose asynchronous execution when the backup file is larger than 500MB. If you choose asynchronous execution, the additional permission policies required are as follows: [fc:DeleteFunctionAsyncInvokeConfig, fc:GetStatefulAsyncInvocation, fc:PutFunctionAsyncInvokeConfig]'
      zh-cn: FC函數的執行配置:同步執行或非同步執行 使用FC上傳備份時,若您的備份檔案較大,可能會因為FC同步執行的60s已耗用時間限制導致備份上傳失敗,建議您在備份檔案大於500MB時選擇非同步執行。若您選擇非同步執行,需要的額外權限原則如下:[fc:DeleteFunctionAsyncInvokeConfig, fc:GetStatefulAsyncInvocation, fc:PutFunctionAsyncInvokeConfig]
    AllowedValues:
      - sync
      - async
    Default: sync
  rateControl:
    Label:
      en: RateControl
      zh-cn: 任務執行的並發比率
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: GetInstance
    Description:
      en: Get the redis instances
      zh-cn: 擷取Redis執行個體
    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
      zh-cn: 建立Redis備份並上傳到OSS
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      OSSRegionId: '{{ OSSRegionId }}'
      OSSBucketName: '{{ OSSBucketName }}'
      invokeConfig: '{{ invokeConfig }}'
    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 }}'