This topic describes the parameters in the metadata of an event target.

Parameters

The following table describes the parameters in the metadata of an event target.

Parameter Type Description
resourceKey String The key of the resource that is used in event transformation.
resourceName String The name of the resource that is used in event transformation.
forms String The transformation method. The following transformation methods are supported:
  • ORIGINAL: complete event. You do not need to specify the value or template field. EventBridge routes the complete data structure of an event in the CloudEvents format to an event target without transformation. For more information, see the "Complete event" section in Event transformation.
  • JSONPATH: partial event. You need to specify only the value field and do not need to specify the template field. EventBridge extracts fields from an event in the CloudEvents format by using JSONPath and routes the specified part of the event to an event target. For more information, see the "Partial event" section in Event transformation.
    Sample value of the value field:
    $.data.name
  • CONSTANT: constant. You need to specify only the value field and do not need to specify the template field. EventBridge routes only constants specified by the value field to an event target regardless of event context. For more information, see the "Constant" section in Event transformation.
    Sample value of the value field:
    "test1"
  • TEMPLATE: template. You must specify the value and template fields. EventBridge extracts fields from an event in the CloudEvents format by using JSONPath, stores the field values in the value field, and then routes the event in the format that is specified by the template field to an event target. For more information, see the "Template" section in Event transformation.
    Sample value of the value field:
    {
        "name":"$.data.name",
        "constant":"Please deal with it timely."
    }
    Sample value of the template field:
    The instance is broken, which name is ${name}, ${constant}

DingTalk

The following table describes the parameters that you can set if you select DingTalk as the event target.

resourceKey resourceName forms
URL Address CONSTANT
SecretKey Secret Key CONSTANT
Body Pushed Content TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.dingtalk",
    "endpoint":"https://oapi.dingtalk.com/robot/send?access_token=1560abe367f48877c69bb6a9916244979927abbbbf82f4fe8801692cd6ea****",
    "paramList":[
        {
            "value":"https://oapi.dingtalk.com/robot/send?access_token=1560abe367f48877c69bb6a9916244979927abbbbf82f4fe8801692cd6ea****",
            "resourceKey":"URL",
            "form":"CONSTANT"
        },
        {
            "value":"SEC1eca5209e0c6c23165b9504967522d47b0d0004e1caf3a75f6ddfda7359d****",
            "resourceKey":"SecretKey",
            "form":"CONSTANT"
        },
        {
            "value":{
                "content":"$.data.content"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":{
                "msgtype":"text",
                "text":{
                    "content":"@1851111***** ${content}"
                },
                "at":{

                }
            }
        }
    ]
}

Direct Mail

The following table describes the parameters that you can set if you select Direct Mail as the event target.

resourceKey resourceName forms
Subject Subject CONSTANT
AccountName Sender Address CONSTANT
AddressType Address Type CONSTANT
ReplyToAddress Return Address CONSTANT
ToAddress Recipient
  • CONSTANT
  • JSONPATH
IsHtmlBody HTML Body CONSTANT
Body Body TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.mail",
    "endpoint":"acs:mail:cn-hangzhou:164901546557****",
    "paramList":[
        {
            "value":"test",
            "resourceKey":"Subject",
            "form":"CONSTANT"
        },
        {
            "value":"example.com",
            "resourceKey":"AccountName",
            "form":"CONSTANT"
        },
        {
            "value":"1",
            "resourceKey":"AddressType",
            "form":"CONSTANT"
        },
        {
            "value":"true",
            "resourceKey":"ReplyToAddress",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"ToAddress",
            "form":"JSONPATH"
        },
        {
            "value":"true",
            "resourceKey":"IsHtmlBody",
            "form":"CONSTANT"
        },
        {
            "value":{
                "mobile":"$.data.mobile",
                "subject":"$.subject"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":{
                "code":"${subject}"
            }
        }
    ]
}

SMS

The following table describes the parameters that you can set if you select Short Message Service (SMS) as the event target.

resourceKey resourceName forms
PhoneNumbers Phone Number
  • CONSTANT
  • JSONPATH
SignName Signature CONSTANT
TemplateCode Template Code CONSTANT
TemplateParam Template Parameters TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.sms",
    "endpoint":"acs:sms:cn-hangzhou:164901546557****",
    "paramList":[
        {
            "value":"$.data",
            "resourceKey":"PhoneNumbers",
            "form":"JSONPATH"
        },
        {
            "value":"[Test] Alibaba Cloud Communication",
            "resourceKey":"SignName",
            "form":"CONSTANT"
        },
        {
            "value":"[Test] Alibaba Cloud Communication Test Template",
            "resourceKey":"TemplateCode",
            "form":"CONSTANT"
        },
        {
            "value":{
                "mobile":"$.data.mobile",
                "subject":"$.subject"
            },
            "resourceKey":"TemplateParam",
            "form":"TEMPLATE",
            "template":{
                "code":"${subject}"
            }
        }
    ]
}

Function Compute

The following table describes the parameters that you can set if you select Function Compute as the event target.

resourceKey resourceName forms
serviceName Service CONSTANT
functionName Function CONSTANT
Body Event
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.fc.function",
    "endpoint":"acs:fc:cn-hangzhou:164901546557****:services/guide-hello_world.LATEST/functions/hello_world",
    "paramList":[
        {
            "value":"guide-hello_world",
            "resourceKey":"serviceName",
            "form":"CONSTANT"
        },
        {
            "value":"hello_world",
            "resourceKey":"functionName",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"LATEST",
            "resourceKey":"Qualifier",
            "form":"CONSTANT"
        }
    ]
}

MNS

The following table describes the parameters that you can set if you select Message Service (MNS) as the event target.

resourceKey resourceName forms
queue Queue CONSTANT
Body Message Content
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.mns.queue",
    "endpoint":"acs:mns:cn-hangzhou:164901546557****:queues/MyQueue",
    "paramList":[
        {
            "value":"MyQueue",
            "resourceKey":"queue",
            "form":"CONSTANT"
        },
        {
            "value":{
                "source":"$.source"
            },
            "resourceKey":"Body",
            "form":"TEMPLATE",
            "template":"The event comes from ${source} is abnormal."
        }
    ]
}

Message Queue for Apache RocketMQ

The following table describes the parameters that you can set if you select Message Queue for Apache RocketMQ as the event target.

resourceKey resourceName forms
InstanceId Instance ID CONSTANT
Topic Topic CONSTANT
Body Body
  • ORIGINAL
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Properties Properties
  • JSONPATH
  • TEMPLATE
Keys Keys
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Tags Tags
  • JSONPATH
  • CONSTANT
  • TEMPLATE

The following code shows an example of JSONPath:

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.rocketmq",
    "endpoint":"acs:mq:cn-hangzhou:164901546557****:/instances/${instanceId}/topic/${topic}",
    "paramList":[
        {
            "value":"MQ_INST_164901546557****_BAAQ4gWo",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test-topic1",
            "resourceKey":"Topic",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userProperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.systemProperties.KEYS",
            "resourceKey":"Keys",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.systemProperties.TAGS",
            "resourceKey":"Tags",
            "form":"JSONPATH"
        }
    ]
}

Message Queue for RabbitMQ

The following table describes the parameters that you can set if you select Message Queue for RabbitMQ as the event target.

resourceKey resourceName forms
InstanceId Instance ID CONSTANT
Vhost Vhost CONSTANT
TargetType Destination Type CONSTANT
Exchange Exchange CONSTANT
Note You can set only one of the Exchange and Queue parameters.
Routing Key Routing Key
  • JSONPATH
  • CONSTANT
Queue Queue CONSTANT
Note You can set only one of the Exchange and Queue parameters.
Body Body
  • ORIGINAL
  • JSONPATH
  • CONSTANT
  • TEMPLATE
MessageId Message ID
  • JSONPATH
  • CONSTANT
  • TEMPLATE
Properties Properties
  • JSONPATH
  • TEMPLATE

The following code shows examples of JSONPath:

Example 1: The TargetType resource is set to Exchange.

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"acs.rabbitmq",
    "endpoint":"acs:amqp:cn-hangzhou:164901546557****:/instances/${instanceId}/vhosts/${vhostName}/exchanges/${exchangeName}",
    "paramList":[
        {
            "value":"amqp-cn-i7m29o3s****",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test.host",
            "resourceKey":"Vhost",
            "form":"CONSTANT"
        },
        {
            "value":"Exchange",
            "resourceKey":"TargetType",
            "form":"CONSTANT"
        },
        {
            "value":"amq.direct",
            "resourceKey":"Exchange",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.name",
            "resourceKey":"RoutingKey",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.name",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.message",
            "resourceKey":"MessageId",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userProperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        }
    ]
}

Example 2: The TargetType resource is set to Queue.

{
    "id":"EldwXoVAws5Ix8VpVmrDmrxQTR",
    "type":"acs.rabbitmq",
    "endpoint":"acs:amqp:cn-hangzhou:164901546557****:/instances/${instanceId}/vhosts/${vhostName}/exchanges/${exchangeName}",
    "paramList":[
        {
            "value":"amqp-cn-i7m29o3s****",
            "resourceKey":"InstanceId",
            "form":"CONSTANT"
        },
        {
            "value":"test.host",
            "resourceKey":"Vhost",
            "form":"CONSTANT"
        },
        {
            "value":"Queue",
            "resourceKey":"TargetType",
            "form":"CONSTANT"
        },
        {
            "value":"test.event",
            "resourceKey":"Queue",
            "form":"CONSTANT"
        },
        {
            "value":"$.data.body",
            "resourceKey":"Body",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.message",
            "resourceKey":"MessageId",
            "form":"JSONPATH"
        },
        {
            "value":"$.data.userproperties",
            "resourceKey":"Properties",
            "form":"JSONPATH"
        }
    ]
}

HTTP/HTTPS

The following table describes the parameters that you can set if you select HTTP or HTTPS as the event target.

resourceKey resourceName forms
url URL CONSTANT
Body Body
  • ORIGINAL
  • CONSTANT
  • JSONPATH
  • TEMPLATE
Network Network Type CONSTANT
VPCNameAndId VPC CONSTANT
VSwitchesNameAndId vSwitch CONSTANT
SecurityGroupNameAndId Security Group CONSTANT
Token Token CONSTANT

The following code shows examples of JSONPath:

Example 1: The Network resource is set to PublicNetwork.

{
    "id":"KD20k9rpqDRXPq0SXXlqeTn6kZ",
    "type":"http(s)",
    "endpoint":"http(s)://www.****.com/product/aliware/eventbridge",
    "paramList":[
        {
            "value":"http(s)://www.****.com/product/aliware/eventbridge",
            "resourceKey":"url",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Body",
            "form":"ORIGINAL"
        },
        {
            "value":"PublicNetwork",
            "resourceKey":"Network",
            "form":"CONSTANT"
        }
    ]
}

Example 2: The Network resource is set to PrivateNetwork.

{
    "id":"ZOiNcqqzTGSrDJanZQ72vjL9Se",
    "type":"http(s)",
    "endpoint":"http(s)://192.168.XX.XX:8080",
    "paramList":[
        {
            "value":"http(s)://192.168.XX.XX:8080",
            "resourceKey":"url",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Body",
            "form":"ORIGINAL"
        },
        {
            "value":"PrivateNetwork",
            "resourceKey":"Network",
            "form":"CONSTANT"
        },
        {
            "value":"catalog-system/vpc-bp1ohdo84u2lt9wzq****",
            "resourceKey":"VPCNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"[\"eb/vsw-bp10rbrt6rb6vrd89****\"]",
            "resourceKey":"VSwitchesNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"sg-catalog-eventlistener/sg-bp14zrnfyik5av27****",
            "resourceKey":"SecurityGroupNameAndId",
            "form":"CONSTANT"
        },
        {
            "value":"",
            "resourceKey":"Token",
            "form":"CONSTANT"
        }
    ]
}

Databases

  • The following table describes the parameters that you can set if you select ApsaraDB RDS for MySQL as the event target.
    resourceKey resourceName forms
    concurrency Concurrency N/A
    InstanceId Instance ID CONSTANT
    DBName Database Name CONSTANT
    AccountName Database Account CONSTANT
    AccountPassword Database Password CONSTANT
    ExecuteSQL Custom SQL
    • ORIGINAL
    • CONSTANT
    • JSONPATH
    • TEMPLATE
    VpcId VPC CONSTANT
    VSwitchIds vSwitch CONSTANT
    SecurityGroupId Security Group CONSTANT

    The following code shows an example of JSONPath:

    {
        "id":"BRTt1sNe3IvdvejN07k5Sb****",
        "type":"acs.rds.mysql",
        "endpoint":"acs:rds:cn-zhangjiakou:164901546557****:dbinstance/${dbinstanceid}",
        "concurrentConfig":{
            "concurrency":10
        },
        "paramList":[
            {
                "value":"rm-8vban2a66q93o****",
                "resourceKey":"InstanceId",
                "form":"CONSTANT"
            },
            {
                "value":"db-test",
                "resourceKey":"DBName",
                "form":"CONSTANT"
            },
            {
                "value":"db_name",
                "resourceKey":"AccountName",
                "form":"CONSTANT"
            },
            {
                "value":"Aliyun****",
                "resourceKey":"AccountPassword",
                "form":"CONSTANT"
            },
            {
                "value":"{\n    \"tableName\": \"customer\",\n    \"column1\": \"$.data.tableName\",\n    \"column1_value\": \"$.data.id\"\n}",
                "template":"INSERT INTO ${tableName} \n (${column1}) VALUES('${column1_value}')",
                "resourceKey":"ExecuteSQL",
                "form":"TEMPLATE"
            },
            {
                "value":"vpc-8vbeokru8z8erie8e****",
                "resourceKey":"VpcId",
                "form":"CONSTANT"
            },
            {
                "value":"vsw-8vb9alm00nf29ijxt****",
                "resourceKey":"VSwitchIds",
                "form":"CONSTANT"
            }
            {
                "value":"sg-8vbb59f5vq1ydiwr****",
                "resourceKey":"SecurityGroupId",
                "form":"CONSTANT"
            }
        ]
    }
  • The following table describes the parameters that you can set if you select a self-managed MySQL database as the event target.
    resourceKey resourceName forms
    concurrency Concurrency N/A
    Network Network CONSTANT
    VpcId VPC CONSTANT
    VSwitchIds vSwitch CONSTANT
    ConnectionStringAndPort Database Address CONSTANT
    DBName Database Name CONSTANT
    AccountName Database Account CONSTANT
    AccountPassword Database Password CONSTANT
    ExecuteSQL Custom SQL
    • ORIGINAL
    • CONSTANT
    • JSONPATH
    • TEMPLATE

    Example 1: The Network resource is set to PublicNetwork.

    {
        "id":"HmfVOvdG4k1NK9qJiqrxtv****",
        "type":"mysql",
        "endpoint":"192.168.XX.XX:3306",
        "concurrentConfig":{
            "concurrency":10
        },
        "paramList":[
            {
                "value":"192.168.XX.XX:3306",
                "resourceKey":"ConnectionStringAndPort",
                "form":"CONSTANT"
            },
            {
                "value":"db-test",
                "resourceKey":"DBName",
                "form":"CONSTANT"
            },
            {
                "value":"dbTest",
                "resourceKey":"AccountName",
                "form":"CONSTANT"
            },
            {
                "value":"Mydb****",
                "resourceKey":"AccountPassword",
                "form":"CONSTANT"
            },
            {
                "value":"{\n    \"tableName\": \"user\",\n    \"column1\": \"$.data.tableName\",\n    \"column1_value\": \"$.data.id\"\n}",
                "template":"INSERT INTO ${tableName} \n (${column1}) VALUES('${column1_value}')",
                "resourceKey":"ExecuteSQL",
                "form":"TEMPLATE"
            },
        ]
    }

    Example 2: The Network resource is set to PrivateNetwork.

    {
        "id":"HmfVOvdG4k1NK9qJiqrxtv****",
        "type":"mysql",
        "endpoint":"192.168.XX.XX:3306",
        "concurrentConfig":{
            "concurrency":10
        },
        "paramList":[
            {
                "value":"vpc-8vbeokru8z8erie8e****",
                "resourceKey":"VpcId",
                "form":"CONSTANT"
            },
            {
                "value":"vsw-8vbo9jk84z0obm24f****",
                "resourceKey":"VSwitchIds",
                "form":"CONSTANT"
            },
            {
                "value":"192.168.XX.XX:3306",
                "resourceKey":"ConnectionStringAndPorte",
                "form":"CONSTANT"
            },
            {
                "value":"my-db",
                "resourceKey":"DBName",
                "form":"CONSTANT"
            },
            {
                "value":"dmsTest",
                "resourceKey":"AccountName",
                "form":"TEMPLATE"
            },
            {
                "value":"Mydb****",
                "resourceKey":"AccountPassword",
                "form":"CONSTANT"
            },
            {
                "value":"{\n    \"tableName\": \"user\",\n    \"column1\": \"$.data.tableName\",\n    \"column1_value\": \"$.data.id\"\n}",
                "template": "INSERT INTO ${tableName} \n (${column1}) VALUES('${column1_value}')",
                "resourceKey":"ExecuteSQL",
                "form":"TEMPLATE"
            }
        ]
    }