ALIYUN::HBR::Policy

更新时间:
复制为 MD 格式

ALIYUN::HBR::Policy类型用于创建策略。

语法

{
  "Type": "ALIYUN::HBR::Policy",
  "Properties": {
    "PolicyType": String,
    "PolicyName": String,
    "Rules": List,
    "PolicyDescription": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

PolicyName

String

策略的名称。

PolicyType

String

策略的类型。

取值:

  • STANDARD

  • UDM_ECS_ONLY

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

规则的类型。

取值:

  • BACKUP

  • TRANSITION

  • REPLICATION

  • SECURITY

  • TAG

ArchiveDays

Integer

规则的归档天数。

ArchiveVaultId

String

规则的归档仓库ID。

BackupType

String

规则的备份类型。

取值:

  • COMPLETE

  • INCREMENTAL

  • DIFFERENTIAL

  • LOG

  • INDEX

  • ARCHIVE

  • ARCHIVE_BY_SEARCH

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

标签过滤器的操作符。

取值:

  • EQUAL

  • NOT

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

保留规则的高级保留类型。

取值:

  • DAILY

  • WEEKLY

  • MONTHLY

  • YEARLY

Retention

Integer

保留规则的保留期。

WhichSnapshot

Integer

保留规则的哪个快照。

取值:

  • 1

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"
        ]
      }
    }
  }
}