ALIYUN::HBR::Policy类型用于创建策略。
语法
{
"Type": "ALIYUN::HBR::Policy",
"Properties": {
"PolicyType": String,
"PolicyName": String,
"Rules": List,
"PolicyDescription": String
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
PolicyName |
String |
是 |
是 |
策略的名称。 |
无 |
|
PolicyType |
String |
是 |
是 |
策略的类型。 |
取值:
|
|
Rules |
List |
是 |
是 |
策略的规则。 |
长度范围:1-10。更多信息,请参考Rules属性。 |
|
PolicyDescription |
String |
否 |
是 |
策略的描述。 |
无 |
Rules语法
"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
}
]
Rules属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
RuleType |
String |
是 |
否 |
规则的类型。 |
取值:
|
|
ArchiveDays |
Integer |
否 |
否 |
规则的归档天数。 |
无 |
|
ArchiveVaultId |
String |
否 |
否 |
规则的归档仓库ID。 |
无 |
|
BackupType |
String |
否 |
否 |
规则的备份类型。 |
取值:
|
|
ColdArchiveDays |
Integer |
否 |
否 |
规则的冷归档天数。 |
无 |
|
Continuous |
Boolean |
否 |
否 |
规则是否连续。 |
无 |
|
DataSourceFilters |
List |
否 |
否 |
规则的数据源过滤器。 |
更多信息,请参考DataSourceFilters属性。 |
|
DoDetect |
Boolean |
否 |
否 |
规则是否进行检测。 |
无 |
|
Immutable |
Boolean |
否 |
否 |
规则是否不可变。 |
无 |
|
KeepLatestSnapshots |
Integer |
否 |
否 |
规则保留的最新快照。 |
无 |
|
ReplicationRegionId |
String |
否 |
否 |
规则的复制区域ID。 |
无 |
|
ReplicationVaultId |
String |
否 |
否 |
规则的复制仓库ID。 |
无 |
|
Retention |
Integer |
否 |
否 |
规则的保留期。 |
范围:1-364635 |
|
RetentionRules |
List |
否 |
否 |
规则的保留规则。 |
最大长度:99。更多信息,请参考RetentionRules属性。 |
|
Schedule |
String |
否 |
否 |
规则的计划。 |
无 |
|
Selector |
Map |
否 |
否 |
规则的选择器。 |
更多信息,请参考Selector属性。 |
|
TagFilters |
List |
否 |
否 |
规则的标签过滤器。 |
更多信息,请参考TagFilters属性。 |
|
VaultId |
String |
否 |
否 |
规则的仓库ID。 |
无 |
TagFilters语法
"TagFilters": [
{
"Operator": String,
"Value": String,
"Key": String
}
]
TagFilters属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Key |
String |
否 |
否 |
标签过滤器的键。 |
无 |
|
Operator |
String |
否 |
否 |
标签过滤器的操作符。 |
取值:
|
|
Value |
String |
否 |
否 |
标签过滤器的值。 |
无 |
DataSourceFilters语法
"DataSourceFilters": [
{
"CrossAccountUserId": String,
"CrossAccountRoleName": String,
"SourceType": String,
"CrossAccountType": String
}
]
DataSourceFilters属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
CrossAccountRoleName |
String |
否 |
否 |
数据源过滤器的跨账号角色名称。 |
无 |
|
CrossAccountType |
String |
否 |
否 |
数据源过滤器的跨账号类型。 |
无 |
|
CrossAccountUserId |
String |
否 |
否 |
数据源过滤器的跨账号用户ID。 |
无 |
|
SourceType |
String |
否 |
否 |
数据源过滤器的源类型。 |
无 |
RetentionRules语法
"RetentionRules": [
{
"AdvancedRetentionType": String,
"WhichSnapshot": Integer,
"Retention": Integer
}
]
RetentionRules属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
AdvancedRetentionType |
String |
否 |
否 |
保留规则的高级保留类型。 |
取值:
|
|
Retention |
Integer |
否 |
否 |
保留规则的保留期。 |
无 |
|
WhichSnapshot |
Integer |
否 |
否 |
保留规则的哪个快照。 |
取值:
|
Selector语法
"Selector": {
"Value": String,
"Key": String
}
Selector属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Key |
String |
否 |
否 |
选择器的键。 |
无 |
|
Value |
String |
否 |
否 |
选择器的值。 |
无 |
返回值
Fn::GetAtt
PolicyId:策略的ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
PolicyType:
Type: String
Description:
en: The type of the policy.
AllowedValues:
- STANDARD
- UDM_ECS_ONLY
Required: true
PolicyDescription:
Type: String
Description:
en: The description of the policy.
Required: false
PolicyName:
Type: String
Description:
en: The name of the policy.
Required: true
Rules:
AssociationPropertyMetadata:
Parameter:
AssociationPropertyMetadata:
Parameters:
Immutable:
Type: Boolean
Description:
en: Whether immutable of the rule.
Required: false
ReplicationVaultId:
Type: String
Description:
en: The replication vault ID of the rule.
Required: false
Continuous:
Type: Boolean
Description:
en: Whether continuous of the rule.
Required: false
KeepLatestSnapshots:
Type: Number
Description:
en: The keep latest snapshots of the rule.
Required: false
ColdArchiveDays:
Type: Number
Description:
en: The cold archive days of the rule.
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 of the rule.
Required: false
ArchiveDays:
Type: Number
Description:
en: The archive days of the rule.
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 retention of the rule.
Required: false
MinValue: 1
MaxValue: 364635
ArchiveVaultId:
Type: String
Description:
en: The archive vault ID of the rule.
Required: false
VaultId:
Type: String
Description:
en: The vault ID of the rule.
Required: false
Schedule:
Type: String
Description:
en: The schedule of the rule.
Required: false
BackupType:
Type: String
Description:
en: The backup type of the rule.
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 of the data source filter.
Required: false
CrossAccountRoleName:
Type: String
Description:
en: The cross account role name of the data source filter.
Required: false
SourceType:
Type: String
Description:
en: The source type of the data source filter.
Required: false
CrossAccountType:
Type: String
Description:
en: The cross account type of the data source filter.
Required: false
Type: Json
AssociationProperty: List[Parameters]
Description:
en: The data source filters of the rule.
Required: false
RetentionRules:
AssociationPropertyMetadata:
Parameters:
AdvancedRetentionType:
Type: String
Description:
en: The advanced retention type of the retention rule.
AllowedValues:
- DAILY
- WEEKLY
- MONTHLY
- YEARLY
Required: false
WhichSnapshot:
Type: Number
Description:
en: The which snapshot of the retention rule.
AllowedValues:
- 1
Required: false
Retention:
Type: Number
Description:
en: The retention of the retention rule.
Required: false
Type: Json
AssociationProperty: List[Parameters]
Description:
en: The retention rules of the rule.
Required: false
MaxLength: 99
DoDetect:
Type: Boolean
Description:
en: Whether do detect of the rule.
Required: false
ReplicationRegionId:
Type: String
Description:
en: The replication region ID of the rule.
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 of the rule.
Required: false
Type: Json
Required: false
Type: Json
AssociationProperty: List[Parameter]
Description:
en: The rules of the policy.
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 ID of the policy.
Value:
Fn::GetAtt:
- Policy
- PolicyId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"PolicyType": {
"Type": "String",
"Description": {
"en": "The type of the policy."
},
"AllowedValues": [
"STANDARD",
"UDM_ECS_ONLY"
],
"Required": true
},
"PolicyDescription": {
"Type": "String",
"Description": {
"en": "The description of the policy."
},
"Required": false
},
"PolicyName": {
"Type": "String",
"Description": {
"en": "The name of the policy."
},
"Required": true
},
"Rules": {
"AssociationPropertyMetadata": {
"Parameter": {
"AssociationPropertyMetadata": {
"Parameters": {
"Immutable": {
"Type": "Boolean",
"Description": {
"en": "Whether immutable of the rule."
},
"Required": false
},
"ReplicationVaultId": {
"Type": "String",
"Description": {
"en": "The replication vault ID of the rule."
},
"Required": false
},
"Continuous": {
"Type": "Boolean",
"Description": {
"en": "Whether continuous of the rule."
},
"Required": false
},
"KeepLatestSnapshots": {
"Type": "Number",
"Description": {
"en": "The keep latest snapshots of the rule."
},
"Required": false
},
"ColdArchiveDays": {
"Type": "Number",
"Description": {
"en": "The cold archive days of the rule."
},
"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 of the rule."
},
"Required": false
},
"ArchiveDays": {
"Type": "Number",
"Description": {
"en": "The archive days of the rule."
},
"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 retention of the rule."
},
"Required": false,
"MinValue": 1,
"MaxValue": 364635
},
"ArchiveVaultId": {
"Type": "String",
"Description": {
"en": "The archive vault ID of the rule."
},
"Required": false
},
"VaultId": {
"Type": "String",
"Description": {
"en": "The vault ID of the rule."
},
"Required": false
},
"Schedule": {
"Type": "String",
"Description": {
"en": "The schedule of the rule."
},
"Required": false
},
"BackupType": {
"Type": "String",
"Description": {
"en": "The backup type of the rule."
},
"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 of the data source filter."
},
"Required": false
},
"CrossAccountRoleName": {
"Type": "String",
"Description": {
"en": "The cross account role name of the data source filter."
},
"Required": false
},
"SourceType": {
"Type": "String",
"Description": {
"en": "The source type of the data source filter."
},
"Required": false
},
"CrossAccountType": {
"Type": "String",
"Description": {
"en": "The cross account type of the data source filter."
},
"Required": false
}
}
},
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"Description": {
"en": "The data source filters of the rule."
},
"Required": false
},
"RetentionRules": {
"AssociationPropertyMetadata": {
"Parameters": {
"AdvancedRetentionType": {
"Type": "String",
"Description": {
"en": "The advanced retention type of the retention rule."
},
"AllowedValues": [
"DAILY",
"WEEKLY",
"MONTHLY",
"YEARLY"
],
"Required": false
},
"WhichSnapshot": {
"Type": "Number",
"Description": {
"en": "The which snapshot of the retention rule."
},
"AllowedValues": [
1
],
"Required": false
},
"Retention": {
"Type": "Number",
"Description": {
"en": "The retention of the retention rule."
},
"Required": false
}
}
},
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"Description": {
"en": "The retention rules of the rule."
},
"Required": false,
"MaxLength": 99
},
"DoDetect": {
"Type": "Boolean",
"Description": {
"en": "Whether do detect of the rule."
},
"Required": false
},
"ReplicationRegionId": {
"Type": "String",
"Description": {
"en": "The replication region ID of the rule."
},
"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 of the rule."
},
"Required": false
}
}
},
"Type": "Json",
"Required": false
}
},
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"Description": {
"en": "The rules of the policy."
},
"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 ID of the policy.",
"Value": {
"Fn::GetAtt": [
"Policy",
"PolicyId"
]
}
}
}
}