模板名称
ACS-Redis-BulkyCreateBackupAndUploadToOSS 批量创建Redis备份并上传到OSS
模板描述
批量创建Redis备份并上传到OSS。备份redis和使用fc将备份上传到oss都可能会产生费用,计费详情参考Redis备份费用说明和函数计算计费说明
模板类型
自动化
所有者
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://help.aliyun.com/zh/ fc/product-overview/billing-overview'>Function calculation billing instructions</a>
zh-cn: 批量创建Redis备份并上传到OSS。备份redis和使用fc将备份上传到oss都可能会产生费用,计费详情参考<a href='https://help.aliyun.com/zh/redis/user-guide/automatic-or-manual-backup#e606eb29c7mew'>Redis备份费用说明</a>和<a href='https://help.aliyun.com/zh/fc/product-overview/billing-overview'>函数计算计费说明</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 }}'
该文章对您有帮助吗?