全部产品
Search
文档中心

资源编排:ALIYUN::ARMS::ApplyAlertRuleTemplate

更新时间:Oct 09, 2024

ALIYUN::ARMS::ApplyAlertRuleTemplate类型用于创建Prometheus告警规则。

语法

{
  "Type": "ALIYUN::ARMS::ApplyAlertRuleTemplate",
  "Properties": {
    "ClusterIds": List,
    "TemplateIds": List,
    "Update": Boolean
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ClusterIds

List

Prometheus集群列表。

限制:1~100个。

TemplateIds

List

Prometheus告警规则模板列表

限制:1~100个。

Update

Boolean

是否更新已创建的警报规则。

取值:

  • true:更新。

  • false(默认值):不更新。

返回值

Fn::GetAtt

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterIds:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: The ID of the Prometheus Instance.
        Required: true
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: The IDs list of Prometheus Instances.
    Required: false
    MinLength: 1
    MaxLength: 100
  TemplateIds:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: The ID of the Prometheus alert rule template.
        Required: true
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: The IDs list of Prometheus alert rule templates.
    Required: false
    MinLength: 1
    MaxLength: 100
Resources:
  ApplyAlertRuleTemplate:
    Type: ALIYUN::ARMS::ApplyAlertRuleTemplate
    Properties:
      ClusterIds:
        Ref: ClusterIds
      TemplateIds:
        Ref: TemplateIds

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterIds": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "The ID of the Prometheus Instance."
          },
          "Required": true
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "The IDs list of Prometheus Instances."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 100
    },
    "TemplateIds": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "The ID of the Prometheus alert rule template."
          },
          "Required": true
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "The IDs list of Prometheus alert rule templates."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 100
    }
  },
  "Resources": {
    "ApplyAlertRuleTemplate": {
      "Type": "ALIYUN::ARMS::ApplyAlertRuleTemplate",
      "Properties": {
        "ClusterIds": {
          "Ref": "ClusterIds"
        },
        "TemplateIds": {
          "Ref": "TemplateIds"
        }
      }
    }
  }
}