O tipo ALIYUN::CMS::DynamicTagGroup cria automaticamente grupos de aplicativos para produtos cloud.
Atualmente, esse recurso é compatível apenas com Elastic Compute Service (ECS), Relational Database Service (RDS) e Server Load Balancer (SLB).
Sintaxe
{
"Type": "ALIYUN::CMS::DynamicTagGroup",
"Properties": {
"ContactGroupList": List,
"MatchExpressFilterRelation": String,
"EnableSubscribeEvent": Boolean,
"TemplateIdList": List,
"TagKey": String,
"EnableInstallAgent": Boolean,
"MatchExpress": List
}
}
Propriedades
Nome da propriedade | Tipo | Obrigatório | Atualização permitida | Descrição | Restrições |
ContactGroupList | List | Sim | Não | Contatos de alerta. | Nenhuma |
TagKey | String | Sim | Não | Chave da tag. | Nenhuma |
EnableInstallAgent | Boolean | Não | Não | Define se a instalação inicial do agente de monitoramento deve ser ativada. | Valores válidos:
Nota Se uma instância ECS no grupo de aplicativos não tiver o agente de monitoramento instalado, o sistema tentará instalá-lo automaticamente. |
EnableSubscribeEvent | Boolean | Não | Não | Define se a assinatura de eventos deve ser ativada. | Valores válidos:
|
MatchExpress | List | Não | Não | Expressões condicionais. | Configure no máximo três expressões condicionais. Para mais informações, consulte Propriedades de MatchExpress. |
MatchExpressFilterRelation | String | Não | Não | Relação lógica entre as expressões condicionais. | Valores válidos:
|
TemplateIdList | List | Não | Não | ID do modelo de alerta. | Nenhuma |
Sintaxe de MatchExpress
"MatchExpress": [
{
"TagValue": String,
"TagValueMatchFunction": String
}
]
Propriedades de MatchExpress
Nome da propriedade | Tipo | Obrigatório | Atualização permitida | Descrição | Restrições |
TagValue | String | Sim | Não | Valor da tag. | Nenhuma |
TagValueMatchFunction | String | Sim | Não | Método de correspondência do valor da tag. | Valores válidos:
|
Valores de retorno
Fn::GetAtt
DynamicTagRuleId: ID da regra de tag dinâmica.
TagKey: chave da tag.
Exemplos
O código a seguir contém informações confidenciais. Substitua-as pelos seus parâmetros reais.
Formato YAML
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
Formato JSON
{
"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"
]
}
}
}
}