The ALIYUN::HBR::Policy type creates a policy.
Syntax
{
"Type": "ALIYUN::HBR::Policy",
"Properties": {
"PolicyType": String,
"PolicyName": String,
"Rules": List,
"PolicyDescription": String
}
}Properties
Parameter | Type | Required | Editable | Description | Constraints |
PolicyName | String | Yes | Yes | The policy name. | None |
PolicyType | String | Yes | Yes | The policy type. | Valid values:
|
Rules | List | Yes | Yes | The policy rules. | Length: 1 to 10. For more information, see the Rules property. |
PolicyDescription | String | No | Yes | The policy description. | None |
Rules syntax
"Rules": [
{
"Immutable": Boolean,
"ReplicationVaultId": String,
"Continuous": Boolean,
"KeepLatestSnapshots": Integer,
"ColdArchiveDays": Integer,
"TagFilters": List,
"ArchiveDays": Integer,
"RuleType": String,
"Retention": Integer,
"ArchiveVaultId": String,
"VaultId": String,
"Schedule": String,
"BackupType": String,
"DataSourceFilters": List,
"RetentionRules": List,
"DoDetect": Boolean,
"ReplicationRegionId": String,
"Selector": Map
}
]Rule properties
Parameter | Type | Required | Editable | Description | Constraints |
RuleType | String | Yes | No | The type of the rule. | Valid values:
|
ArchiveDays | Integer | No | No | The number of days after which backups are archived. | None |
ArchiveVaultId | String | No | No | The ID of the archive vault. | None |
BackupType | String | No | No | The type of the backup. | Valid values:
|
ColdArchiveDays | Integer | No | No | The number of days before archived backups are moved to cold storage. | None |
Continuous | Boolean | No | No | Specifies whether to enable continuous backups. | None |
DataSourceFilters | List | No | No | A list of filters for the data source. | For more information, see DataSourceFilters properties. |
DoDetect | Boolean | No | No | Specifies whether to enable detection. | None |
Immutable | Boolean | No | No | Specifies whether backups created by this rule are immutable. | None |
KeepLatestSnapshots | Integer | No | No | The number of latest snapshots to retain. | None |
ReplicationRegionId | String | No | No | The ID of the destination region for replication. | None |
ReplicationVaultId | String | No | No | The ID of the destination vault for replication. | None |
Retention | Integer | No | No | The backup retention period, in days. | Range: 1 to 364635 |
RetentionRules | List | No | No | A list of retention rules. | Maximum length: 99. For more information, see RetentionRules properties. |
Schedule | String | No | No | The execution schedule for the rule. | None |
Selector | Map | No | No | The selector for the rule. | For more information, see Selector properties. |
TagFilters | List | No | No | A list of tag filters. | For more information, see TagFilters properties. |
VaultId | String | No | No | The ID of the vault. | None |
TagFilters syntax
"TagFilters": [
{
"Operator": String,
"Value": String,
"Key": String
}
]TagFilters properties
Parameter | Type | Required | Editable | Description | Constraints |
Key | String | No | No | The tag filter key. | None |
Operator | String | No | No | The tag filter operator. | Valid values:
|
Value | String | No | No | The tag filter value. | None |
DataSourceFilters syntax
"DataSourceFilters": [
{
"CrossAccountUserId": String,
"CrossAccountRoleName": String,
"SourceType": String,
"CrossAccountType": String
}
]DataSourceFilters properties
Parameter | Type | Required | Editable | Description | Constraint |
CrossAccountRoleName | String | No | No | The name of the role for cross-account access. | None |
CrossAccountType | String | No | No | The type of cross-account access. | None |
CrossAccountUserId | String | No | No | The user ID for cross-account access. | None |
SourceType | String | No | No | The type of the data source. | None |
RetentionRules syntax
"RetentionRules": [
{
"AdvancedRetentionType": String,
"WhichSnapshot": Integer,
"Retention": Integer
}
]RetentionRules properties
Parameter | Type | Required | Editable | Description | Constraints |
AdvancedRetentionType | String | No | No | The advanced retention type for the retention rule. | Valid values:
|
Retention | Integer | No | No | The retention period for the retention rule. | None |
WhichSnapshot | Integer | No | No | The specific snapshot to retain. | Valid values:
|
Selector syntax
"selector": {
"value": String,
"key": String
}Selector properties
Parameter | Type | Required | Editable | Description | Constraints |
key | String | No | No | The selector's key. | None |
value | String | No | No | The selector's value. | None |
Return values
Fn::GetAtt
PolicyId: The ID of the policy.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
PolicyType:
Type: String
Description:
en: The policy type.
AllowedValues:
- STANDARD
- UDM_ECS_ONLY
Required: true
PolicyDescription:
Type: String
Description:
en: The policy description.
Required: false
PolicyName:
Type: String
Description:
en: The policy name.
Required: true
Rules:
AssociationPropertyMetadata:
Parameter:
AssociationPropertyMetadata:
Parameters:
Immutable:
Type: Boolean
Description:
en: Indicates if backups created by this rule are immutable.
Required: false
ReplicationVaultId:
Type: String
Description:
en: The destination vault ID for replication.
Required: false
Continuous:
Type: Boolean
Description:
en: Whether to enable continuous backups for the rule.
Required: false
KeepLatestSnapshots:
Type: Number
Description:
en: The number of latest snapshots to keep.
Required: false
ColdArchiveDays:
Type: Number
Description:
en: The number of days after which an archived backup is moved to a cold archive vault.
Required: false
TagFilters:
AssociationPropertyMetadata:
Parameters:
Operator:
Type: String
Description:
en: The operator of the tag filter.
AllowedValues:
- EQUAL
- NOT
Required: false
Value:
Type: String
Description:
en: The value of the tag filter.
Required: false
Key:
Type: String
Description:
en: The key of the tag filter.
Required: false
Type: Json
AssociationProperty: List[Parameters]
Description:
en: The tag filters for the rule.
Required: false
ArchiveDays:
Type: Number
Description:
en: The number of days to retain backups before they are archived.
Required: false
RuleType:
Type: String
Description:
en: The type of the rule.
AllowedValues:
- BACKUP
- TRANSITION
- REPLICATION
- SECURITY
- TAG
Required: true
Retention:
Type: Number
Description:
en: The backup retention period, in days.
Required: false
MinValue: 1
MaxValue: 364635
ArchiveVaultId:
Type: String
Description:
en: The archive vault ID.
Required: false
VaultId:
Type: String
Description:
en: The vault ID.
Required: false
Schedule:
Type: String
Description:
en: The schedule for the rule.
Required: false
BackupType:
Type: String
Description:
en: The backup type.
AllowedValues:
- COMPLETE
- INCREMENTAL
- DIFFERENTIAL
- LOG
- INDEX
- ARCHIVE
- ARCHIVE_BY_SEARCH
Required: false
DataSourceFilters:
AssociationPropertyMetadata:
Parameters:
CrossAccountUserId:
Type: String
Description:
en: The cross-account user ID for the data source filter.
Required: false
CrossAccountRoleName:
Type: String
Description:
en: The cross-account role name for the data source filter.
Required: false
SourceType:
Type: String
Description:
en: The source type for the data source filter.
Required: false
CrossAccountType:
Type: String
Description:
en: The cross-account type for the data source filter.
Required: false
Type: Json
AssociationProperty: List[Parameters]
Description:
en: The data source filters for the rule.
Required: false
RetentionRules:
AssociationPropertyMetadata:
Parameters:
AdvancedRetentionType:
Type: String
Description:
en: The advanced retention type for the retention rule.
AllowedValues:
- DAILY
- WEEKLY
- MONTHLY
- YEARLY
Required: false
WhichSnapshot:
Type: Number
Description:
en: Which snapshot to retain.
AllowedValues:
- 1
Required: false
Retention:
Type: Number
Description:
en: The retention period for this rule.
Required: false
Type: Json
AssociationProperty: List[Parameters]
Description:
en: The retention rules.
Required: false
MaxLength: 99
DoDetect:
Type: Boolean
Description:
en: Whether to perform detection for the rule.
Required: false
ReplicationRegionId:
Type: String
Description:
en: The destination region ID for replication.
Required: false
Selector:
AssociationPropertyMetadata:
Parameters:
Value:
Type: String
Description:
en: The value of the selector.
Required: false
Key:
Type: String
Description:
en: The key of the selector.
Required: false
Type: Json
Description:
en: The selector for the rule.
Required: false
Type: Json
Required: false
Type: Json
AssociationProperty: List[Parameter]
Description:
en: The policy rules.
Required: true
MinLength: 1
MaxLength: 10
Resources:
Policy:
Type: ALIYUN::HBR::Policy
Properties:
PolicyType:
Ref: PolicyType
PolicyDescription:
Ref: PolicyDescription
PolicyName:
Ref: PolicyName
Rules:
Ref: Rules
Outputs:
PolicyId:
Description: The policy ID.
Value:
Fn::GetAtt:
- Policy
- PolicyId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"PolicyType": {
"Type": "String",
"Description": {
"en": "The policy type."
},
"AllowedValues": [
"STANDARD",
"UDM_ECS_ONLY"
],
"Required": true
},
"PolicyDescription": {
"Type": "String",
"Description": {
"en": "The policy description."
},
"Required": false
},
"PolicyName": {
"Type": "String",
"Description": {
"en": "The policy name."
},
"Required": true
},
"Rules": {
"AssociationPropertyMetadata": {
"Parameter": {
"AssociationPropertyMetadata": {
"Parameters": {
"Immutable": {
"Type": "Boolean",
"Description": {
"en": "Indicates if backups created by this rule are immutable."
},
"Required": false
},
"ReplicationVaultId": {
"Type": "String",
"Description": {
"en": "The destination vault ID for replication."
},
"Required": false
},
"Continuous": {
"Type": "Boolean",
"Description": {
"en": "Whether to enable continuous backups for the rule."
},
"Required": false
},
"KeepLatestSnapshots": {
"Type": "Number",
"Description": {
"en": "The number of latest snapshots to keep."
},
"Required": false
},
"ColdArchiveDays": {
"Type": "Number",
"Description": {
"en": "The number of days after which an archived backup is moved to a cold archive vault."
},
"Required": false
},
"TagFilters": {
"AssociationPropertyMetadata": {
"Parameters": {
"Operator": {
"Type": "String",
"Description": {
"en": "The operator of the tag filter."
},
"AllowedValues": [
"EQUAL",
"NOT"
],
"Required": false
},
"Value": {
"Type": "String",
"Description": {
"en": "The value of the tag filter."
},
"Required": false
},
"Key": {
"Type": "String",
"Description": {
"en": "The key of the tag filter."
},
"Required": false
}
}
},
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"Description": {
"en": "The tag filters for the rule."
},
"Required": false
},
"ArchiveDays": {
"Type": "Number",
"Description": {
"en": "The number of days to retain backups before they are archived."
},
"Required": false
},
"RuleType": {
"Type": "String",
"Description": {
"en": "The type of the rule."
},
"AllowedValues": [
"BACKUP",
"TRANSITION",
"REPLICATION",
"SECURITY",
"TAG"
],
"Required": true
},
"Retention": {
"Type": "Number",
"Description": {
"en": "The backup retention period, in days."
},
"Required": false,
"MinValue": 1,
"MaxValue": 364635
},
"ArchiveVaultId": {
"Type": "String",
"Description": {
"en": "The archive vault ID."
},
"Required": false
},
"VaultId": {
"Type": "String",
"Description": {
"en": "The vault ID."
},
"Required": false
},
"Schedule": {
"Type": "String",
"Description": {
"en": "The schedule for the rule."
},
"Required": false
},
"BackupType": {
"Type": "String",
"Description": {
"en": "The backup type."
},
"AllowedValues": [
"COMPLETE",
"INCREMENTAL",
"DIFFERENTIAL",
"LOG",
"INDEX",
"ARCHIVE",
"ARCHIVE_BY_SEARCH"
],
"Required": false
},
"DataSourceFilters": {
"AssociationPropertyMetadata": {
"Parameters": {
"CrossAccountUserId": {
"Type": "String",
"Description": {
"en": "The cross-account user ID for the data source filter."
},
"Required": false
},
"CrossAccountRoleName": {
"Type": "String",
"Description": {
"en": "The cross-account role name for the data source filter."
},
"Required": false
},
"SourceType": {
"Type": "String",
"Description": {
"en": "The source type for the data source filter."
},
"Required": false
},
"CrossAccountType": {
"Type": "String",
"Description": {
"en": "The cross-account type for the data source filter."
},
"Required": false
}
}
},
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"Description": {
"en": "The data source filters for the rule."
},
"Required": false
},
"RetentionRules": {
"AssociationPropertyMetadata": {
"Parameters": {
"AdvancedRetentionType": {
"Type": "String",
"Description": {
"en": "The advanced retention type for the retention rule."
},
"AllowedValues": [
"DAILY",
"WEEKLY",
"MONTHLY",
"YEARLY"
],
"Required": false
},
"WhichSnapshot": {
"Type": "Number",
"Description": {
"en": "Which snapshot to retain."
},
"AllowedValues": [
1
],
"Required": false
},
"Retention": {
"Type": "Number",
"Description": {
"en": "The retention period for this rule."
},
"Required": false
}
}
},
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"Description": {
"en": "The retention rules."
},
"Required": false,
"MaxLength": 99
},
"DoDetect": {
"Type": "Boolean",
"Description": {
"en": "Whether to perform detection for the rule."
},
"Required": false
},
"ReplicationRegionId": {
"Type": "String",
"Description": {
"en": "The destination region ID for replication."
},
"Required": false
},
"Selector": {
"AssociationPropertyMetadata": {
"Parameters": {
"Value": {
"Type": "String",
"Description": {
"en": "The value of the selector."
},
"Required": false
},
"Key": {
"Type": "String",
"Description": {
"en": "The key of the selector."
},
"Required": false
}
}
},
"Type": "Json",
"Description": {
"en": "The selector for the rule."
},
"Required": false
}
}
},
"Type": "Json",
"Required": false
}
},
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"Description": {
"en": "The policy rules."
},
"Required": true,
"MinLength": 1,
"MaxLength": 10
}
},
"Resources": {
"Policy": {
"Type": "ALIYUN::HBR::Policy",
"Properties": {
"PolicyType": {
"Ref": "PolicyType"
},
"PolicyDescription": {
"Ref": "PolicyDescription"
},
"PolicyName": {
"Ref": "PolicyName"
},
"Rules": {
"Ref": "Rules"
}
}
}
},
"Outputs": {
"PolicyId": {
"Description": "The policy ID.",
"Value": {
"Fn::GetAtt": [
"Policy",
"PolicyId"
]
}
}
}
}