ALIYUN::CMS::MetricRuleTemplateDeployment is used to apply an alert template to an application group.
Syntax
{
"Type": "ALIYUN::CMS::MetricRuleTemplateDeployment",
"Properties": {
"GroupId": Integer,
"TemplateIds": List,
"AppendMode": String,
"ApplyMode": String,
"EnableEndTime": Integer,
"EnableStartTime": Integer,
"NotifyLevel": Integer,
"SilenceTime": Integer,
"Webhook": String
}
}Properties
Property | Type | Required | Editable | Description | Constraint |
GroupId | Integer | Yes | No | The ID of the application group. | For more information about how to query the application group ID, see DescribeMonitorGroups. |
TemplateIds | List | Yes | No | The ID of the alert template. | For more information about how to query the alert template ID, see DescribeMetricRuleTemplateList. |
AppendMode | String | No | No | The policy for applying the alert template. | Valid values:
|
ApplyMode | String | No | No | The mode in which the alert template is applied. | Valid values:
|
EnableEndTime | Integer | No | No | The end of the time period during which the alert rule is effective. | Valid values: 00 to 23. A value of 00 indicates 00:59 and a value of 23 indicates 23:59. |
EnableStartTime | Integer | No | No | The beginning of the time period during which the alert rule is effective. | Valid values: 00 to 23. A value of 00 indicates 00:00 and a value of 23 indicates 23:00. |
NotifyLevel | Integer | No | No | The alert notification method. | Valid values:
|
SilenceTime | Integer | No | No | The mute period during which notifications are not repeatedly sent for an alert. | Unit: seconds. Default value: 86400. Note Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times. |
Webhook | String | No | No | The callback URL to which a POST request is sent when an alert is triggered based on the alert rule. | None. |
Return values
Fn::GetAtt
RuleIds: the IDs of the alert rules.
GroupId: the ID of the application group.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TemplateIds:
AssociationPropertyMetadata:
Parameter:
Type: String
Required: false
MinLength: 1
AssociationProperty: List[Parameter]
Type: Json
Description:
en: |-
The ID list of the Alarm Template to be applied.
For how to get the alarm template ID, see DescribeMetricRuleTemplateList.
Required: true
MinLength: 1
GroupId:
Type: Number
Description:
en: |-
Apply group ID.
For how to get the application group ID, see DescribeMonitorGroups.
Required: true
MaxValue: 9007199254740991
Resources:
MetricRuleTemplateDeployment:
Type: ALIYUN::CMS::MetricRuleTemplateDeployment
Properties:
TemplateIds:
Ref: TemplateIds
GroupId:
Ref: GroupId
Outputs:
RuleIds:
Description: The IDs of rhe generated rules.
Value:
Fn::GetAtt:
- MetricRuleTemplateDeployment
- RuleIds
GroupId:
Description: The ID of the group that applied the template to.
Value:
Fn::GetAtt:
- MetricRuleTemplateDeployment
- GroupId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TemplateIds": {
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Required": false,
"MinLength": 1
}
},
"AssociationProperty": "List[Parameter]",
"Type": "Json",
"Description": {
"en": "The ID list of the Alarm Template to be applied.\nFor how to get the alarm template ID, see DescribeMetricRuleTemplateList."
},
"Required": true,
"MinLength": 1
},
"GroupId": {
"Type": "Number",
"Description": {
"en": "Apply group ID.\nFor how to get the application group ID, see DescribeMonitorGroups."
},
"Required": true,
"MaxValue": 9007199254740991
}
},
"Resources": {
"MetricRuleTemplateDeployment": {
"Type": "ALIYUN::CMS::MetricRuleTemplateDeployment",
"Properties": {
"TemplateIds": {
"Ref": "TemplateIds"
},
"GroupId": {
"Ref": "GroupId"
}
}
}
},
"Outputs": {
"RuleIds": {
"Description": "The IDs of rhe generated rules.",
"Value": {
"Fn::GetAtt": [
"MetricRuleTemplateDeployment",
"RuleIds"
]
}
},
"GroupId": {
"Description": "The ID of the group that applied the template to.",
"Value": {
"Fn::GetAtt": [
"MetricRuleTemplateDeployment",
"GroupId"
]
}
}
}
}