Amazon EventBridge API Destinations to Shopify

EventBridge rule → Connection → API

Create an EventBridge rule and API destination to route events to Shopify

This pattern creates an API Destination for the Shopify Create Product API. Once deployed, the pattern allows a user to send events easily through EventBridge to create products in a Shopify store. The pattern creates the following resources: EventBridge Bus, EventBridge Connection, EventBridge API Destination, EventBridge Rule, IAM Role, and SQS Queue.
The EventBridge rule uses the API Destination and Connection as a target, SQS Queue as a DLQ, and the IAM role as its role. To send events go to the bus and send sample events.
To create a product, enter “MyShopifyApp” for the source, the bus created by the pattern for the Event Bus Name, and any call that follows the format for posting products as the detail (https://shopify.dev/api/admin-rest/2021-10/resources/product#post-products).
Before using the pattern a Shopify app and Admin Key with the appropriate permissions should be created. (https://shopify.dev/apps/auth/admin-app-access-tokens#step-1-create-and-install-the-app).
The following information is needed to run the template:
- Shopify Admin Key: To create the AUTH for the EventBridge Connection
- Shopify Store Name: To construct the call for the API destination
The IAM role created by the pattern only has the permission to allow InvokeApiDestination access to the EventBridge Rule.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-api-destinations

Deploy

cd ./9-shopifysam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Omid Khan

Omid Khan

AWS Associate Solutions Architect

Camilla Somtakoune

Camilla Somtakoune

AWS Solutions Architect