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