The ALIYUN::CMS::DynamicTagGroup type is used to automatically create application groups for cloud products.
This feature is currently supported only for Elastic Compute Service (ECS), Relational Database Service (RDS), and Server Load Balancer (SLB).
Syntax
{
"Type": "ALIYUN::CMS::DynamicTagGroup",
"Properties": {
"ContactGroupList": List,
"MatchExpressFilterRelation": String,
"EnableSubscribeEvent": Boolean,
"TemplateIdList": List,
"TagKey": String,
"EnableInstallAgent": Boolean,
"MatchExpress": List
}
}Properties
Property name | Type | Required | Update Allowed | Description | Constraints |
ContactGroupList | List | Yes | No | The alert contacts. | None |
TagKey | String | Yes | No | The tag key. | None |
EnableInstallAgent | Boolean | No | No | Specifies whether to enable initial installation of the monitoring agent. | Valid values:
Note If an ECS instance in the application group does not have the monitoring agent installed, the system attempts to automatically install it. |
EnableSubscribeEvent | Boolean | No | No | Specifies whether to enable event subscription. | Valid values:
|
MatchExpress | List | No | No | The conditional expressions. | You can configure a maximum of three conditional expressions. For more information, see MatchExpress properties. |
MatchExpressFilterRelation | String | No | No | The relationship between the conditional expressions. | Valid values:
|
TemplateIdList | List | No | No | The ID of the alert template. | None |
MatchExpress syntax
"MatchExpress": [
{
"TagValue": String,
"TagValueMatchFunction": String
}
]MatchExpress properties
Property Name | Type | Required | Update Allowed | Description | Constraints |
TagValue | String | Yes | No | The tag value. | None |
TagValueMatchFunction | String | Yes | No | The matching method for the tag value. | Valid values:
|
Return values
Fn::GetAtt
DynamicTagRuleId: The ID of the dynamic tag rule.
TagKey: The tag key.
Examples
The following code contains sensitive information. Replace this information with your actual parameters.
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
MatchExpressFilterRelation:
Type: String
Description: The logical relationship between conditional expressions. Valid values: and, or.
AllowedValues:
- and
- or
Default: or
EnableSubscribeEvent:
Type: Boolean
Description: Specifies whether to enable event subscription. Valid values: true, false.
AllowedValues:
- true
- false
Default: false
ContactGroupList:
Type: Json
Description: The alert 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
JSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"MatchExpressFilterRelation": {
"Type": "String",
"Description": "The logical relationship between conditional expressions. Valid values: and, or.",
"AllowedValues": [
"and",
"or"
],
"Default": "or"
},
"EnableSubscribeEvent": {
"Type": "Boolean",
"Description": "Specifies whether to enable event subscription. Valid values: true, false.",
"AllowedValues": [
true,
false
],
"Default": false
},
"ContactGroupList": {
"Type": "Json",
"Description": "The alert 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"
]
}
}
}
}