You can use EventBridge to route events to third-party services like Zendesk
In this tutorial, you'll use the EventBridge console to create a connection to Zendesk, an API destination that points to Zendesk, and a rule to route events to Zendesk.
Steps:
Prerequisites
To complete this tutorial, you'll need the following resources:
An EventBridge-enabled Amazon Simple Storage Service (Amazon S3) bucket.
Step 1: Create connection
To send events to Zendesk, you'll first have to establish a connection to the Zendesk API.
To create the connection
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
In the navigation pane, choose API destinations.
-
Choose the Connections tab, and then choose Create connection.
-
Enter a name and description for the connection. For example, enter
Zendesk
for the name, andConnection to Zendesk API
for the description. -
For Authorization type, choose Basic (Username/Password).
-
For Username, enter your Zendesk username.
-
For Password, enter your Zendesk password.
-
Choose Create.
Step 2: Create API destination
Now that you've created the connection, you'll next create the API destination to use as the target of the rule.
To create the API Destination
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
In the navigation pane, choose API destinations.
-
Choose Create API destination.
-
Enter a name and description for the API destination. For example, enter
ZendeskAD
for the name, andZendesk API destination
for the description. -
For API destination endpoint, enter
https://
, whereyour-subdomain
.zendesk.com/api/v2/tickets.jsonyour-subdomain
is the subdomain associated with your Zendesk account. -
For HTTP method, choose POST.
-
For Invocation rate limit, enter
10
. -
For Connection, choose Use an existing connection and choose the
Zendesk
connection you created in step 1. -
Choose Create.
Step 3: Create rule
Next, create a rule to send events to Zendesk when an Amazon S3 object is created.
To create a rule
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
In the navigation pane, choose Rules.
-
Choose Create rule.
-
Enter a name and description for the rule. For example, enter
ZendeskRule
for the name, andRule to send events to Zendesk when S3 objects are created
for the description. -
For Event bus, choose default.
-
For Rule type, choose Rule with an event pattern.
-
Choose Next.
-
For Event source, choose Other.
-
For Event pattern, enter the following:
{ "source": ["aws.s3"] }
-
Choose Next.
-
For Target types, choose EventBridge API destination.
-
For API destination, choose Use an existing API destination, and then choose the
ZendeskAD
destination you created in step 2. -
For Execution role, choose Create a new for role for this specific resource.
-
For Additional settings, do the following:
-
For Configure target input, choose Input transformer from the drop-down list.
-
Choose Configure input transformer
-
for Sample events, enter the following:
{ "detail":[] }
-
For Target input transformer do the following:
-
For Input Path, enter the following:
{"detail":"$.detail"}
-
For Input Template, enter the following:
{"message": <detail>}
-
Choose Confirm..
-
-
Choose Next.
-
Choose Next.
-
Review the details of the rule and choose Create rule.
Step 4: Test the rule
To test your rule, create an Amazon S3
object by uploading a file to an EventBridge-enabled bucket.
When the event matches the rule, EventBridge will call the Zendesk
Create Ticket API
Step 5: Clean up your resources
You can now delete the resources that you created for this tutorial, unless you want to retain them. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account.
To delete the EventBridge Connections(s)
-
Open the API destination page
of the EventBridge console. -
Choose the Connections tab.
-
Select the Connection(s) you created.
-
Choose Delete.
-
Enter the name of the connection and choose Delete.
To delete the EventBridge API destination(s)
-
Open the API destination page
of the EventBridge console. -
Select the API destinations(s) you created.
-
Choose Delete.
-
Enter the name of the API destination and choose Delete.
To delete the EventBridge rule(s)
-
Open the Rules page
of the EventBridge console. -
Select the rule(s) that you created.
-
Choose Delete.
-
Choose Delete.