ACS-EventBridge-PutEvents

更新时间:
复制为 MD 格式

模板名称

ACS-EventBridge-PutEvents EventBridge发布事件

立即执行

模板描述

发布一个事件

模板类型

自动化

所有者

Alibaba Cloud

输入参数

参数名称

描述

类型

是否必填

默认值

约束

eventBusName

事件总线的名称

String

source

事件源

String

regionId

地域 ID

String

{{ ACS::RegionId }}

id

事件ID

String

{{ ACS::ExecutionId }}

type

事件类型

String

aliyunoos:Execution:Success

data

事件内容

Json

{"name": "Eventbridge", "number": 100}

OOSAssumeRole

OOS扮演的RAM角色

String

""

输出参数

参数名称

描述

类型

responses

Json

执行此模板需要的权限策略

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "eventbridge:TestPutEvents"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

详情

ACS-EventBridge-PutEvents详情

模板内容

FormatVersion: OOS-2019-06-01
Description:
  name-en: ACS-EventBridge-PutEvents
  name-zh-cn: EventBridge发布事件
  en: Put one or more events
  zh-cn: 发布一个事件
  categories:
    - security
Parameters:
  regionId:
    Type: String
    Label:
      en: Region Id
      zh-cn: 地域 ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  eventBusName:
    Label:
      en: EventBusName
      zh-cn: 事件总线的名称
    Type: String
  id:
    Type: String
    Label:
      en: Event ID
      zh-cn: 事件ID
    Description:
      en: Event ID. A unique value that identifies an event. The sender must ensure that source + id is unique.
      zh-cn: 事件ID。标识事件的唯一值。发送端必须确保source+id是唯一的
    Default: '{{ ACS::ExecutionId }}'
  source:
    Type: String
    Label:
      en: Source
      zh-cn: 事件源
    Description:
      en: Event source. A service that provides events. Identifies the context of the event. This typically includes the type of event source, the mechanism for publishing events, or the process that produced the event.
      zh-cn: 事件源。提供事件的服务。标识事件发生的内容。一般会包含事件源的类型,发布事件的机制或生产事件的过程。
  type:
    Type: String
    Label:
      en: Type
      zh-cn: 事件类型
    Description:
      en: Event type. Describes the event type associated with the event source. This parameter is used for routing, event querying, and policy execution.
      zh-cn: 事件类型。描述事件源相关的事件类型。该参数用于路由、事件查询和策略执行等。
    Default: 'aliyunoos:Execution:Success'
  data:
    Type: Json
    Label:
      en: Data
      zh-cn: 事件内容
    Description:
      en: Event content. A JSON object whose content is determined by the service that initiates the event.
      zh-cn: 事件内容。JSON对象,内容由发起事件的服务决定。
    Default:
      name: Eventbridge
      number: 100
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: putEvents
    Action: 'ACS::ExecuteAPI'
    Description:
      en: Publish an event
      zh-cn: 发布一个事件
    Properties:
      Service: EVENTBRIDGE
      API: TestPutEvents
      Parameters:
        RegionId: '{{ regionId }}'
        Event:
          Id: '{{ id }}'
          Type: '{{ type }}'
          Data: '{{ Data }}'
          Source: '{{ source }}'
          AliyunEventbusName: '{{ eventBusName }}'
    Outputs:
      response:
        Type: List
        ValueSelector: .
Outputs:
  responses:
    Type: Json
    Value: '{{ putEvents.response }}'