---
keyword: [Extend, Third Party Technology, AWS]
nav: wcp_docs
parent_url: /wcp_docs/
title: Amazon EventBridge
layout: subsection
---

EventBridge is a serverless service that uses events to connect application components together. A rule matches incoming events and sends them to targets for processing. A target is a resource or endpoint that EventBridge sends an event to when the event matches the event pattern defined for a rule.

Sign in to the [AWS Command Line Interface](https://aws.amazon.com/cli/). For more information, refer to [Authenticate to Workday-Provided AWS Account](/wcp_docs/GUID-aef194e4-cf8a-4d71-8550-a77573a3e512-enHYPHENus.html).

1.  Create a custom event bus.

    1.  Execute the `create-event-bus –-name` CLI command.

    For additional information, please refer to the [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/events/create-event-bus.html).

2.  Create a new rule.

    1.  Execute the `put-rule --name <value>  --event-bus-name <value>  --event-pattern <value>  [--description <value>]` CLI command.
    2.  For `event-bus-name`, enter the name of the custom event bus that you created in Step 1.
    3.  For `event-pattern`, enter the following:

        ```
        “{\"source\":[\"com.workday.extend.outbound\"],\"detail-type\":[\"<Detail Type from Orchestrate>\"]}”
        ```


    For additional information, please refer to the [AWS Command Line Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/events/put-rule.html).

3.  Add a target to the rule.

    1.  Execute the `put-targets --rule <value> --event-bus-name <value> --targets <value>` CLI command.
    2.  For `rule`, enter the name of the rule you created in Step 2.
    3.  For `event-bus-name`, enter the name of the custom event bus that you created in Step 1.
    4.  For `targets`, enter the following:

        ```
        "Id"="1","Arn"="arn:aws:logs:{region}:{account-id}:log-group:tenant-event-bus”
        ```


    For additional information, please refer to the [AWS Command Line Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/events/put-targets.html).



## <a id="section_1"></a>Use Amazon EventBridge to Call Back to Workday

Using API destinations, you can route [events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html) from AWS services to Workday by using API calls. You must first create an API destination for Workday, and then write a new rule to send events from AWS to Workday.

To find the Workday API endpoint from your Orchestration, view the <b>Settings</b> of the Orchestration. Under <b>Source/API</b>, copy the <b>HTTPS URL</b>.

1.  Sign in to the [AWS Command Line Interface](https://aws.amazon.com/cli/).
2.  Execute the `list-connections` CLI command to query the Connection ARN. Save the query result.
3.  Create an API destination.

    1.  Execute the `create-api-destination --name <value> [--description <value>] --connection-arn <value> --invocation-endpoint <value> --http-method <value>` CLI command.
    2.  For `invocation-endpoint`, enter the HTTPS URL you copied from your Orchestration settings.
    3.  For `http-method`, enter `POST`.
    4.  For `connection-arn`, enter the Connection ARN from the query result that you saved in Step 2.
    5.  Note the output (the ARN of the API Destination).

    For additional information, please refer to the [AWS CLI Command Reference](https://docs.aws.amazon.com/cli/latest/reference/events/create-api-destination.html).

4.  Create a new rule.

    1.  Execute the `put-rule --name <value>  --event-bus-name <value>  --event-pattern <value>  [--description <value>]` CLI command.
    2.  For `event-bus-name`, enter the name of the custom event bus that you created previously.
    3.  For `event-pattern`, enter the following:

        ```
        “{\"source\":[\"com.amazon.aws\"],\"detail-type\":[\"<Detail Type you defined for your event>\"]}”
        ```


    For additional information, please refer to the [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/events/put-rule.html).

5.  Add a target to the rule.

    1.  Execute the `put-targets --rule <value> --event-bus-name <value> --targets <value>` CLI command.
    2.  For `rule`, enter the name of the rule you created in Step 4.
    3.  For `event-bus-name`, enter the name of the custom event bus that you created previously.
    4.  For `targets`, enter the following:

        ```
        "Id"="1","Arn"="<ARN of API destination created in Step 3>","RoleArn"="arn:aws:iam::{account-id}:role/WorkdayExtendAPIDestinationEventRole"
        ```


    For additional information, please refer to the [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/events/put-targets.html).



## <a id="section_2"></a>Put Amazon EventBridge Event Component Orchestration

This orchestration enables you to send an event to an Amazon EventBridge event bus.

Using EventBridge allows you to build more resilient and scalable Orchestrations by allowing communication through loosely coupled events. It can also help reduce the amount of custom integration logic you need to write and increase the agility and flexibility of your Orchestration. In the request, you must specify:

<table><thead></thead><tbody><tr><td>Reference Name</td><td>The name you use in the Expression Builder to refer to this component from other components.</td></tr><tr><td>Event Bus Name</td><td>The name of the event bus to which the event should be sent. This can be an expression that evaluates to a string. <i>tenant-event-bus</i> is the name of the event bus in Amazon EventBridge that is pre-created for you.</td></tr><tr><td>Detail</td><td>The JSON-encoded data for the event. This can be an expression that evaluates to a JSON type.</td></tr><tr><td>Detail Type</td><td>A string that represents the type of the event. This can be an expression that evaluates to a string. Identifies, in combination with the Source field, the fields and values that appear in the Detail field. This is used in Amazon EventBridge rules.</td></tr><tr><td>Source</td><td>A string that represents the source of the event. This can be an expression that evaluates to a string. Identifies the service that generated the event. This is used in Amazon EventBridge rules.</td></tr><tr><td>AWS Resources</td><td>A list of ARNs that represent the resources affected by the event. This can be an expression that evaluates to a list of strings. When putting an event on the Amazon EventBridge, specifying AWS resources can help to ensure that the event is delivered to the appropriate targets. AWS resources are the entities in an AWS account that the event pertains to.</td></tr></tbody></table><br/>

For additional details, please refer to [Amazon EventBridge events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html).

If the request is successful, the component will output:

<table><thead></thead><tbody><tr><td>HTTP response code</td><td>The HTTP status code returned by the API indicating the result of the request.</td></tr><tr><td>HTTP response body</td><td>This will be empty for both successful and failed requests.</td></tr><tr><td>Event ID</td><td>A string representing the unique identifier of the event that was put on the Amazon EventBridge, if applicable. This field may be empty if no event was put or there is a failure.</td></tr><tr><td>Error Code</td><td>This field is empty.</td></tr><tr><td>Error Message</td><td>This field is empty.</td></tr><tr><td>Request Id</td><td>The <code>x-amzn-RequestId</code> header in the response corresponds to the <code>requestId</code> field in the output of the Amazon EventBridge PutEvent API call. It is a unique identifier for the request that can be used for troubleshooting purposes.</td></tr></tbody></table><br/>

<b>Note:</b>

-   Ensure that the size of the event entry does not exceed AWS limits.
-   The component sends a single event per execution.
-   The component has a 20 second response timeout, a 10 second server connection timeout, and a 5 minute overall timeout (inclusive of request, connection, and response). The component does not retry for failed requests.


For additional information about Amazon EventBridge, please refer to:

-   [Creating Amazon EventBridge rules that react to events - Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule.html).
-   [Using Amazon EventBridge and AWS Serverless Application Model templates](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-use-sam.html).
-   [Amazon EventBridge Event Bus - Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html).
-   [Amazon EventBridge targets - Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html).


