All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ARMS::ApplyAlertRuleTemplate

Last Updated:Oct 28, 2024

ALIYUN::ARMS::ApplyAlertRuleTemplate is used to create an alert rule of Alibaba Cloud Managed Service for Prometheus.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

ClusterIds

List

No

Yes

The Prometheus clusters.

You can specify 1 to 100 clusters.

TemplateIds

List

No

Yes

The Prometheus alert rule templates.

You can specify 1 to 100 templates.

Update

Boolean

No

Yes

Specifies whether to update the created alert rule.

Valid values:

  • true

  • false (default)

Return values

Fn::GetAtt

None.

Examples

YAML format

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 format

{
  "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"
        }
      }
    }
  }
}