全部产品
Search
文档中心

资源编排:ALIYUN::CMS::EventRuleTargets

更新时间:Apr 18, 2023

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

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

FcParameters

List

函数计算相关参数。

列表最大长度为5。

更多信息,请参见FcParameters属性

WebhookParameters

List

WebHook参数。

列表最大长度为5。

更多信息,请参见WebhookParameters属性

MnsParameters

List

消息服务相关参数。

列表最大长度为5。

更多信息,请参见MnsParameters属性

ContactParameters

List

发送报警相关参数。

更多信息,请参见ContactParameters属性

RuleName

String

报警规则名称。

SlsParameters

List

日志服务相关参数。

列表最大长度为5。

更多信息,请参见SlsParameters属性

FcParameters语法

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

FcParameters属性

属性名称

类型

必须

允许更新

描述

约束

Region

String

函数服务对应的地域。

ServiceName

String

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

Id

String

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

FunctionName

String

函数名称。

WebhookParameters语法

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

WebhookParameters属性

属性名称

类型

必须

允许更新

描述

约束

Url

String

回调的URL。

Protocol

String

协议名。

Id

String

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

Method

String

HTTP回调的请求方法。

取值:

  • GET

  • POST

MnsParameters语法

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

MnsParameters属性

属性名称

类型

必须

允许更新

描述

约束

Queue

String

队列名称。

Region

String

消息服务的地域。

Id

String

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

ContactParameters语法

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

ContactParameters属性

属性名称

类型

必须

允许更新

描述

约束

ContactGroupName

String

报警联系人分组名称。

Id

String

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

Level

String

报警通知级别。

取值:

  • 2

  • 3

  • 4

通知方式:钉钉、Email。

SlsParameters语法

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

SlsParameters属性

属性名称

类型

必须

允许更新

描述

约束

Project

String

日志服务对应的项目。

LogStore

String

日志服务对应的日志库。

Region

String

日志服务对应的地域。

Id

String

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

返回值

Fn::GetAtt

示例

YAML格式

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

JSON格式

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