ALIYUN::CMS::DynamicTagGroup類型用於雲產品自動建立應用分組。
目前只支援Elastic Compute Service(Elastic Compute Service)、阿里雲關係型資料庫RDS(Relational Database Service)、Server Load Balancer(Server Load Balancer)。
文法
{
"Type": "ALIYUN::CMS::DynamicTagGroup",
"Properties": {
"ContactGroupList": List,
"MatchExpressFilterRelation": String,
"EnableSubscribeEvent": Boolean,
"TemplateIdList": List,
"TagKey": String,
"EnableInstallAgent": Boolean,
"MatchExpress": List
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ContactGroupList | List | 是 | 否 | 警示連絡人。 | 無 |
TagKey | String | 是 | 否 | 標籤鍵。 | 無 |
EnableInstallAgent | Boolean | 否 | 否 | 是否啟用初始化安裝監控外掛程式。 | 取值:
說明 如果產生應用分組的ECS執行個體沒有安裝監控外掛程式則會嘗試自動安裝。 |
EnableSubscribeEvent | Boolean | 否 | 否 | 是否啟用事件訂閱。 | 取值:
|
MatchExpress | List | 否 | 否 | 條件運算式。 | 最多支援配置三個條件運算式。 更多資訊,請參見MatchExpress屬性。 |
MatchExpressFilterRelation | String | 否 | 否 | 條件運算式之間的關係。 | 取值:
|
TemplateIdList | List | 否 | 否 | 警示模板ID。 | 無 |
MatchExpress文法
"MatchExpress": [
{
"TagValue": String,
"TagValueMatchFunction": String
}
]
MatchExpress屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
TagValue | String | 是 | 否 | 標籤值。 | 無 |
TagValueMatchFunction | String | 是 | 否 | 標籤值的匹配方法。 | 取值:
|
傳回值
Fn::GetAtt
DynamicTagRuleId:智能標籤規則ID。
TagKey:標籤鍵。
樣本
下方代碼存在脫敏內容,請替換為您實際的參數。
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
MatchExpressFilterRelation:
Type: String
Description: |-
The relationship between the conditional expressions. Values are:
and: the relationship between
or: the relationship or the
Description currently supports only one combination of conditions, the follow-up Ali cloud will support a variety of combinations of conditions.
AllowedValues:
- and
- or
Default: or
EnableSubscribeEvent:
Type: Boolean
Description: |-
Whether the event subscription is enabled. Values are
:true: enable event subscription
false: disable event subscription
AllowedValues:
- true
- false
Default: false
ContactGroupList:
Type: Json
Description: Alarm contacts.
Default:
- ros-ut-group
Resources:
DynamicTagGroup:
Type: ALIYUN::CMS::DynamicTagGroup
Properties:
ContactGroupList:
Ref: ContactGroupList
MatchExpressFilterRelation:
Ref: MatchExpressFilterRelation
EnableSubscribeEvent:
Ref: EnableSubscribeEvent
TemplateIdList: Null
TagKey: test1
EnableInstallAgent: false
MatchExpress:
- TagValue: '1'
TagValueMatchFunction: all
- TagValue: '2'
TagValueMatchFunction: equals
Outputs:
DynamicTagRuleId:
Value:
Fn::GetAtt:
- DynamicTagGroup
- DynamicTagRuleId
TagKey:
Value:
Fn::GetAtt:
- DynamicTagGroup
- TagKey
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"MatchExpressFilterRelation": {
"Type": "String",
"Description": "The relationship between the conditional expressions. Values are:\nand: the relationship between\nor: the relationship or the\nDescription currently supports only one combination of conditions, the follow-up Ali cloud will support a variety of combinations of conditions.",
"AllowedValues": [
"and",
"or"
],
"Default": "or"
},
"EnableSubscribeEvent": {
"Type": "Boolean",
"Description": "Whether the event subscription is enabled. Values are\n:true: enable event subscription\nfalse: disable event subscription",
"AllowedValues": [
true,
false
],
"Default": false
},
"ContactGroupList": {
"Type": "Json",
"Description": "Alarm contacts.",
"Default": ["ros-ut-***"]
}
},
"Resources": {
"DynamicTagGroup": {
"Type": "ALIYUN::CMS::DynamicTagGroup",
"Properties": {
"ContactGroupList": {
"Ref": "ContactGroupList"
},
"MatchExpressFilterRelation": {
"Ref": "MatchExpressFilterRelation"
},
"EnableSubscribeEvent": {
"Ref": "EnableSubscribeEvent"
},
"TemplateIdList": null,
"TagKey": "test1",
"EnableInstallAgent": false,
"MatchExpress": [
{
"TagValue": "1",
"TagValueMatchFunction": "all"
},
{
"TagValue": "2",
"TagValueMatchFunction": "equals"
}
]
}
}
},
"Outputs": {
"DynamicTagRuleId": {
"Value": {
"Fn::GetAtt": [
"DynamicTagGroup",
"DynamicTagRuleId"
]
}
},
"TagKey": {
"Value": {
"Fn::GetAtt": [
"DynamicTagGroup",
"TagKey"
]
}
}
}
}