All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::CMS::EventRuleTargets

Last Updated:May 17, 2023

ALIYUN::CMS::EventRuleTargets is used to add or change the recipients to which alert notifications are sent based on an event-triggered alert rule.

Syntax

{
  "Type": "ALIYUN::CMS::EventRuleTargets",
  "Properties": {
    "FcParameters": List,
    "WebhookParameters": List,
    "MnsParameters": List,
    "ContactParameters": List,
    "RuleName": String,
    "SlsParameters": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

FcParameters

List

No

Yes

The list of Function Compute properties.

The list can contain up to five properties.

For more information, see FcParameters properties.

WebhookParameters

List

No

Yes

The list of webhook properties.

The list can contain up to five properties.

For more information, see WebhookParameters properties.

MnsParameters

List

No

Yes

The list of Message Service (MNS) properties.

The list can contain up to five properties.

For more information, see MnsParameters properties.

ContactParameters

List

No

Yes

The list of contact properties.

For more information, see ContactParameters properties.

RuleName

String

Yes

No

The name of the alert rule.

None.

SlsParameters

List

No

Yes

The list of Log Service properties.

The list can contain up to five properties.

For more information, see SlsParameters properties.

FcParameters syntax

"FcParameters": [
  {
    "Region": String,
    "ServiceName": String,
    "Id": String,
    "FunctionName": String
  }
]

FcParameters properties

Property

Type

Required

Editable

Description

Constraint

Region

String

No

Yes

The region where Function Compute is deployed.

None.

ServiceName

String

No

Yes

The name of the service in Function Compute.

None.

Id

String

No

Yes

The ID of the recipient who you want to add or change.

None.

FunctionName

String

No

Yes

The name of the function.

None.

WebhookParameters syntax

"WebhookParameters": [
  {
    "Url": String,
    "Protocol": String,
    "Id": String,
    "Method": String
  }
]

WebhookParameters properties

Property

Type

Required

Editable

Description

Constraint

Url

String

No

Yes

The callback URL.

None.

Protocol

String

No

Yes

The name of the protocol.

None.

Id

String

No

Yes

The ID of the recipient who you want to add or change.

None.

Method

String

No

Yes

The request method of the HTTP callback.

Valid values:

  • GET

  • POST

MnsParameters syntax

"MnsParameters": [
  {
    "Queue": String,
    "Region": String,
    "Id": String
  }
]

MnsParameters properties

Property

Type

Required

Editable

Description

Constraint

Queue

String

No

Yes

The name of the queue.

None.

Region

String

No

Yes

The region where MNS is deployed.

None.

Id

String

No

Yes

The ID of the recipient who you want to add or change.

None.

ContactParameters syntax

"ContactParameters": [
  {
    "ContactGroupName": String,
    "Id": String,
    "Level": String
  }
]

ContactParameters properties

Property

Type

Required

Editable

Description

Constraint

ContactGroupName

String

No

Yes

The name of the alert contact group.

None.

Id

String

No

Yes

The ID of the recipient who you want to add or change.

None.

Level

String

No

Yes

The level of the alert notification.

Valid values:

  • 2

  • 3

  • 4

Alert notifications are sent by using DingTalk and emails.

SlsParameters syntax

"SlsParameters": [
  {
    "Project": String,
    "LogStore": String,
    "Region": String,
    "Id": String
  }
]

SlsParameters properties

Property

Type

Required

Editable

Description

Constraint

Project

String

No

Yes

The name of the project in Log Service.

None.

LogStore

String

No

Yes

The name of the Logstore in Log Service.

None.

Region

String

No

Yes

The region where Log Service is deployed.

None.

Id

String

No

Yes

The ID of the recipient who you want to add or change.

None.

Return values

Fn::GetAtt

None.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description: Test CMS EventRuleTargets
Parameters:
  ContactGroupName:
    Type: String
    Description: The name must be 2 to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The description must start with a digit or letter. 
    Label: Alert Contact
    ConstraintDescription: '[2, 128] English or Chinese characters'
    MinLength: 2
    MaxLength: 128
    Default: mytest
Resources:
  EventRuleTargets:
    Type: ALIYUN::CMS::EventRuleTargets
    Properties:
      ContactParameters:
        - ContactGroupName:
            Ref: ContactGroupName
          Id: '1'
          Level: '3'
      RuleName:
        Fn::Join:
          - _
          - - EventRule
            - Ref: ALIYUN::StackId
Outputs: {}

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test CMS EventRuleTargets",
  "Parameters": {
    "ContactGroupName": {
      "Type": "String",
      "Description": "The name must be 2 to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The description must start with a digit or letter.",
      "Label": "Alert Contact",
      "ConstraintDescription": "[2, 128] English or Chinese characters",
      "MinLength": 2,
      "MaxLength": 128,
      "Default": "mytest"
    }
  },
  "Resources": {
    "EventRuleTargets": {
      "Type": "ALIYUN::CMS::EventRuleTargets",
      "Properties": {
        "ContactParameters": [
          {
            "ContactGroupName": {
              "Ref": "ContactGroupName"
            },
            "Id": "1",
            "Level": "3"
          }
        ],
        "RuleName": {
          "Fn::Join": [
            "_",
            [
              "EventRule",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        }
      }
    }
  },
  "Outputs": {
  }
}