ALIYUN::CR::RepoSyncRule类型用于创建镜像仓库同步规则。
语法
{
"Type": "ALIYUN::CR::RepoSyncRule",
"Properties": {
"InstanceId": String,
"NamespaceName": String,
"SyncScope": String,
"SyncRuleName": String,
"SyncTrigger": String,
"TargetInstanceId": String,
"TargetRegionId": String,
"TargetNamespaceName": String,
"RepoName": String,
"RepoNameFilter": String,
"TagFilter": String,
"TargetRepoName": String,
"TargetUserId": String
}
}属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
InstanceId | String | 是 | 否 | 源CR实例 ID。 | 无 |
NamespaceName | String | 是 | 否 | 源实例命名空间名称。 | 无 |
SyncScope | String | 是 | 否 | 同步类型。 | 取值:
|
SyncRuleName | String | 是 | 否 | 同步规则名称。 | 无 |
SyncTrigger | String | 是 | 否 | 触发同步动作。 | 取值:
|
TargetInstanceId | String | 是 | 否 | 目标实例 ID。 | 无 |
TargetNamespaceName | String | 是 | 否 | 目标实例命名空间名称。 | 无 |
TargetRegionId | String | 是 | 否 | 目标实例地区 ID。 | 无 |
RepoName | String | 否 | 否 | 源实例仓库名称。 | 无 |
RepoNameFilter | String | 否 | 否 | 仓库过滤规则。 | 说明 该参数仅在同步类型 SyncScope 是 |
TagFilter | String | 否 | 否 | Tag 过滤规则。 | 无 |
TargetRepoName | String | 否 | 否 | 目标实例镜像仓库名称。 | 无 |
TargetUserId | String | 否 | 否 | 目标实例所在的账号 UID。 | 说明 跨账号同步镜像时,需要使用账号 UID。 |
返回值
Fn::GetAtt
SyncRuleId:同步规则 ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SyncScope:
Type: String
Description:
en: 'The synchronization scope. Valid values: REPO, NAMESPACE'
AllowedValues:
- REPO
- NAMESPACE
Required: true
InstanceId:
Type: String
Description:
en: The ID of the CR instance.
Required: true
TargetInstanceId:
Type: String
Description:
en: The ID of the destination instance.
Required: true
SyncRuleName:
Type: String
Description:
en: The name of the image sync rule.
Required: true
NamespaceName:
Type: String
Description:
en: The name of the CR namespace.
Required: true
SyncTrigger:
Type: String
Description:
en: 'The mode of triggering the synchronization rule. Valid values: INITIATIVE, PASSIVE'
AllowedValues:
- INITIATIVE
- PASSIVE
Required: true
TargetRegionId:
Type: String
Description:
en: The ID of the destination region.
Required: true
TargetNamespaceName:
Type: String
Description:
en: The name of the destination namespace.
Required: true
Resources:
ExtensionResource:
Type: ALIYUN::CR::RepoSyncRule
Properties:
SyncScope:
Ref: SyncScope
InstanceId:
Ref: InstanceId
TargetInstanceId:
Ref: TargetInstanceId
SyncRuleName:
Ref: SyncRuleName
NamespaceName:
Ref: NamespaceName
SyncTrigger:
Ref: SyncTrigger
TargetRegionId:
Ref: TargetRegionId
TargetNamespaceName:
Ref: TargetNamespaceName
Outputs:
SyncRuleId:
Description: The ID of the synchronization rule.
Value:
Fn::GetAtt:
- ExtensionResource
- SyncRuleId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SyncScope": {
"Type": "String",
"Description": {
"en": "The synchronization scope. Valid values: REPO, NAMESPACE"
},
"AllowedValues": [
"REPO",
"NAMESPACE"
],
"Required": true
},
"InstanceId": {
"Type": "String",
"Description": {
"en": "The ID of the CR instance."
},
"Required": true
},
"TargetInstanceId": {
"Type": "String",
"Description": {
"en": "The ID of the destination instance."
},
"Required": true
},
"SyncRuleName": {
"Type": "String",
"Description": {
"en": "The name of the image sync rule."
},
"Required": true
},
"NamespaceName": {
"Type": "String",
"Description": {
"en": "The name of the CR namespace."
},
"Required": true
},
"SyncTrigger": {
"Type": "String",
"Description": {
"en": "The mode of triggering the synchronization rule. Valid values: INITIATIVE, PASSIVE"
},
"AllowedValues": [
"INITIATIVE",
"PASSIVE"
],
"Required": true
},
"TargetRegionId": {
"Type": "String",
"Description": {
"en": "The ID of the destination region."
},
"Required": true
},
"TargetNamespaceName": {
"Type": "String",
"Description": {
"en": "The name of the destination namespace."
},
"Required": true
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::CR::RepoSyncRule",
"Properties": {
"SyncScope": {
"Ref": "SyncScope"
},
"InstanceId": {
"Ref": "InstanceId"
},
"TargetInstanceId": {
"Ref": "TargetInstanceId"
},
"SyncRuleName": {
"Ref": "SyncRuleName"
},
"NamespaceName": {
"Ref": "NamespaceName"
},
"SyncTrigger": {
"Ref": "SyncTrigger"
},
"TargetRegionId": {
"Ref": "TargetRegionId"
},
"TargetNamespaceName": {
"Ref": "TargetNamespaceName"
}
}
}
},
"Outputs": {
"SyncRuleId": {
"Description": "The ID of the synchronization rule.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"SyncRuleId"
]
}
}
}
}