Modify the automatic backup policy for multiple Redis instances in bulk by using this OOS template.
Template name
ACS-Redis-BulkyModifyBackupPolicy: Modifies the automatic backup policy for multiple Redis instances.
Template description
Modifies the automatic backup policy for multiple Redis instances.
Template type
Automation
Owner
Alibaba Cloud
Input parameters
|
Parameter |
Description |
Type |
Required |
Default value |
Constraints |
|
preferredBackupPeriod |
The backup cycle. |
List |
Yes |
||
|
OOSAssumeRole |
The RAM role that Operation Orchestration Service (OOS) assumes. |
String |
Yes |
||
|
regionId |
The region ID. |
String |
No |
{{ ACS::RegionId }} |
|
|
targets |
The target instances. |
Json |
No |
{"Type": "ResourceIds", "ResourceIds": [], "RegionId": "{{ regionId }}"} |
|
|
instanceIds |
The list of Redis instance IDs. |
List |
No |
[] |
|
|
rateControl |
The concurrency rate for task execution. |
String |
No |
{"Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10} |
|
|
enableBackupLog |
Specifies whether to enable the data flashback feature. |
String |
No |
1 |
|
|
rateControl |
The concurrency rate for task execution. |
Json |
No |
{"Mode": "Concurrency", "MaxErrors": 0, "Concurrency": 10} |
Output parameters
None.
Permission policy required to run the template
{
"Version": "1",
"Statement": [
{
"Action": [
"kvstore:DescribeInstances",
"kvstore:ModifyBackupPolicy"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Details
For more information, see ACS-Redis-BulkyModifyBackupPolicy details.
Template content
FormatVersion: OOS-2019-06-01
Description:
en: Modifies the backup policy of a Redis instance.
name-en: ACS-Redis-BulkyModifyBackupPolicy
categories:
- security
- tair
Parameters:
regionId:
Label:
en: Region ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: Target Instance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::Redis::Instance
RegionId: regionId
Default:
Type: ResourceIds
ResourceIds: []
RegionId: '{{ regionId }}'
instanceIds:
Label:
en: List of Redis instance IDs
Type: List
Default: []
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${targets}
- {}
preferredBackupTime:
Label:
en: Preferred Backup Time
Description:
en: The time to perform the backup, in the HH:mmZ-HH:mmZ format and in UTC. The time range must be one hour.
Type: String
Default: 18:00Z-19:00Z
preferredBackupPeriod:
Label:
en: Preferred Backup Period
Description:
en: The backup cycle.
Type: List
AllowedValues:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
enableBackupLog:
Label:
en: Enable Backup Log
Description:
en: "Specifies whether to enable the data flashback feature. Valid values: 1 (Enable) and 0 (Disable). To use data flashback, you must also enable Append-only File (AOF) persistence by setting the 'appendonly' parameter to 'yes'. The default value is 0."
Type: String
Default: '1'
rateControl:
Label:
en: RateControl
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
RamRole: '{{ OOSAssumeRole }}'
Conditions:
instanceId:
Fn::Equals:
- '{{ instanceIds }}'
- []
Tasks:
- Name: getInstance
When: instanceId
Description:
en: Gets the Redis instances.
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::Redis::Instance
RegionId: '{{regionId}}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: ModifyBackupPolicy
Action: ACS::ExecuteAPI
Description:
en: Modifies the backup policy of a Redis instance.
Properties:
Service: R-KVSTORE
API: ModifyBackupPolicy
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ ACS::TaskLoopItem }}'
PreferredBackupTime: '{{ preferredBackupTime }}'
PreferredBackupPeriod:
Fn::Join:
- ','
- '{{ preferredBackupPeriod }}'
EnableBackupLog: '{{ enableBackupLog }}'
Loop:
RateControl: '{{ rateControl }}'
Items:
Fn::If:
- Fn::Equals:
- '{{instanceIds}}'
- []
- '{{ getInstance.instanceIds }}'
- '{{ instanceIds}}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- instanceIds
- targets
Label:
default:
en: Select Instances
- Parameters:
- preferredBackupTime
- preferredBackupPeriod
- enableBackupLog
Label:
default:
en: Set Automatic Backup Policy
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced Options