ALIYUN::CMS::EventRuleTargets

更新时间:
复制 MD 格式

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,
    "OpenApiParameters": List,
    "ContactParameters": List,
    "RuleName": String,
    "SlsParameters": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

RuleName

String

Yes

No

The name of the event-triggered alert rule.

None

ContactParameters

List

No

Yes

The contact properties.

For more information, see ContactParameters properties.

FcParameters

List

No

Yes

The Function Compute properties.

You can specify up to five properties.

For more information, see FcParameters properties.

MnsParameters

List

No

Yes

The parameters for an Simple Message Queue (formerly MNS) (SMQ) target.

You can specify up to five properties.

For more information, see MnsParameters properties.

OpenApiParameters

List

No

Yes

The parameters for an API callback.

For more information, see OpenApiParameters properties.

SlsParameters

List

No

Yes

The Simple Log Service properties.

You can specify up to five properties.

For more information, see SlsParameters properties.

WebhookParameters

List

No

Yes

The webhook properties.

You can specify up to five properties.

For more information, see WebhookParameters properties.

FcParameters syntax

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

FcParameters properties

Property

Type

Required

Editable

Description

Constraint

FunctionName

String

No

Yes

The name of the function.

None

Id

String

No

Yes

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

None

Region

String

No

Yes

The region of Function Compute.

None

ServiceName

String

No

Yes

The name of the service in Function Compute.

None

OpenApiParameters syntax

"OpenApiParameters": [
  {
    "Arn": String,
    "Role": String,
    "Region": String,
    "Action": String,
    "JsonParams": Map,
    "Version": String,
    "Product": String,
    "Id": String
  }
]

OpenApiParameters properties

Parameter

Type

Required

Update Allowed

Description

Constraints

Arn

String

No

Yes

The Alibaba Cloud Resource Name (ARN) of the resource.

Format: arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}. The fields are described as follows:

  • Service: The Alibaba Cloud service.

  • Region: The region ID.

  • Account: The ID of the Alibaba Cloud account.

  • ResourceType: The resource type.

  • ResourceId: The ID of the resource. The resource is identified by an Alibaba Cloud Resource Name (ARN). Format: arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}. The fields are described as follows:

  • Service: An Alibaba Cloud product.

  • Region: The ID of the region.

  • Account: The ID of your Alibaba Cloud account.

  • ResourceType: The resource type.

  • ResourceId: The ID of the resource.

Role

String

No

Yes

The name of the role.

None

Region

String

No

Yes

The region where the resource is located.

None

Action

String

No

Yes

The name of the API operation.

None

JsonParams

Map

No

Yes

The parameters for the API callback. The value must be a JSON object.

None

Version

String

No

Yes

The version of the API.

None

Product

String

No

Yes

The product code of the Alibaba Cloud service for the API operation.

None

Id

String

No

Yes

The unique ID of the target.

None

WebhookParameters syntax

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

WebhookParameters properties

Property

Type

Required

Editable

Description

Constraint

Id

String

No

Yes

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

None

Method

String

No

Yes

The request method of the HTTP callback.

Valid values:

  • GET

  • POST

Protocol

String

No

Yes

The name of the protocol.

None

Url

String

No

Yes

The URL of the callback.

None

MnsParameters syntax

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

MnsParameters properties

Property

Type

Required

Editable

Description

Constraint

Id

String

No

Yes

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

None

Queue

String

No

Yes

The name of the queue.

None

Region

String

No

Yes

The region where the Simple Message Queue (formerly MNS) (SMQ) queue or topic is located.

None

Topic

String

No

Yes

The name of the MNS topic.

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 alert contact who you want to add or change.

None

Level

String

No

Yes

The level of the alert notification.

Valid values:

  • 2:The notification methods are phone call、text message、DingTalk、Email。

  • 3:The notification methods are text message、DingTalk、Email。

  • 4:The notification methods are DingTalk、Email。

SlsParameters syntax

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

SlsParameters properties

Property

Type

Required

Editable

Description

Constraint

Id

String

No

Yes

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

None

LogStore

String

No

Yes

The name of the Logstore in Simple Log Service.

None

Project

String

No

Yes

The name of the project in Simple Log Service.

None

Region

String

No

Yes

The region of Simple Log Service.

None

Return values

Fn::GetAtt

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Description: Test CMS EventRuleTargets
Parameters:
  ContactGroupName:
    Type: String
    Description: The name must be 2 to 64 characters in length, start with a letter or a digit, and can contain letters, digits, underscores (_), periods (.), and hyphens (-).
    Label: Alert Contact Group
    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: {}
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test CMS EventRuleTargets",
  "Parameters": {
    "ContactGroupName": {
      "Type": "String",
      "Description": "The name must be 2 to 64 characters in length, start with a letter or a digit, and can contain letters, digits, underscores (_), periods (.), and hyphens (-).",
      "Label": "Alert Contact Group",
      "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": {
  }
}