ALIYUN::CMS::EventRuleTargets

更新时间:
复制为 MD 格式

ALIYUN::CMS::EventRuleTargets类型用于添加或者修改规则的发送目标。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

RuleName

String

报警规则名称。

ContactParameters

List

发送报警相关参数。

更多信息,请参见ContactParameters属性

FcParameters

List

函数计算相关参数。

列表最大长度为5。

更多信息,请参见FcParameters属性

MnsParameters

List

轻量消息队列(原 MNS) SMQ(Simple Message Queue (formerly MNS))相关参数。

列表最大长度为5。

更多信息,请参见MnsParameters属性

OpenApiParameters

List

回调 API 的参数含义。

更多信息,请参见OpenApiParameters属性

SlsParameters

List

日志服务相关参数。

列表最大长度为5。

更多信息,请参见SlsParameters属性

WebhookParameters

List

WebHook参数。

列表最大长度为5。

更多信息,请参见WebhookParameters属性

FcParameters语法

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

FcParameters属性

属性名称

类型

必须

允许更新

描述

约束

FunctionName

String

函数名称。

Id

String

添加或修改规则的对象ID。

Region

String

函数服务对应的地域。

ServiceName

String

函数计算服务的服务名称。

OpenApiParameters语法

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

OpenApiParameters属性

属性名称

类型

必须

允许更新

描述

约束

Arn

String

ARN 资源描述。

格式:arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}。各字段含义如下:

  • Service:阿里云产品。

  • Region:地域 ID。

  • Account:阿里云账号 ID。

  • ResourceType:资源类型。

  • ResourceId:资源 ID。ARN 资源描述。 格式:arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}。各字段含义如下:

  • Service:阿里云产品。

  • Region:地域 ID。

  • Account:阿里云账号 ID。

  • ResourceType:资源类型。

  • ResourceId:资源 ID。

Role

String

角色名称。

Region

String

资源对应的地域。

Action

String

API 名称。

JsonParams

Map

告警回调的 JSON 格式参数。

Version

String

API 的版本。

Product

String

API 对应的云产品 ID。

Id

String

API 回调通知方式的唯一标识。

WebhookParameters语法

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

WebhookParameters属性

属性名称

类型

必须

允许更新

描述

约束

Id

String

添加或修改规则的对象ID。

Method

String

HTTP回调的请求方法。

取值:

  • GET

  • POST

Protocol

String

协议名。

Url

String

回调的URL。

MnsParameters语法

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

MnsParameters属性

属性名称

类型

必须

允许更新

描述

约束

Id

String

添加或修改规则的对象ID。

Queue

String

队列名称。

Region

String

轻量消息队列(原 MNS) SMQ(Simple Message Queue (formerly MNS))的地域。

Topic

String

轻量消息队列(原 MNS)的主题。

ContactParameters语法

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

ContactParameters属性

属性名称

类型

必须

允许更新

描述

约束

ContactGroupName

String

报警联系人分组名称。

Id

String

添加或修改规则的对象ID。

Level

String

报警通知级别。

取值:

  • 2:通知方式为电话、短信、钉钉、Email。

  • 3:通知方式为短信、钉钉、Email。

  • 4:通知方式为钉钉、Email。

SlsParameters语法

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

SlsParameters属性

属性名称

类型

必须

允许更新

描述

约束

Id

String

添加或修改规则的对象ID。

LogStore

String

日志服务对应的日志库。

Project

String

日志服务对应的项目。

Region

String

日志服务对应的地域。

返回值

Fn::GetAtt

示例

ROSTemplateFormatVersion: '2015-09-01'
Description: Test CMS EventRuleTargets
Parameters:
  ContactGroupName:
    Type: String
    Description: 名称为2-64个字符,以大小写字母,数字或中文开头,可包含(._-)。
    Label: 报警联系人
    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": "名称为2-64个字符,以大小写字母,数字或中文开头,可包含(._-)。",
      "Label": "报警联系人",
      "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": {
  }
}