-
Notifications
You must be signed in to change notification settings - Fork 969
New serverless pattern - Eventbridge to AppSync Events API #2712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New serverless pattern - Eventbridge to AppSync Events API #2712
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
@@ -0,0 +1,102 @@ | |||
# AWS EventBridge to AWS AppSync Events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# AWS EventBridge to AWS AppSync Events | |
# Sending events from Amazon EventBridge to AWS AppSync Events |
|
||
This pattern demonstrates how you can send events from EventBridge to an AppSync Events API. This will allow you to consume events in real-time over WebSockets. This stack will deploy the following resources: | ||
|
||
- **EventBridge EventBus**: Use this event bus to send messages to for testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **EventBridge EventBus**: Use this event bus to send messages to for testing. | |
- **EventBridge event bus**: Use this event bus to send messages to for testing. |
|
||
## How it works | ||
|
||
A new EventBus is created with a rule to catch events in your account which match a specified detail-type. These events are then sent to an API Destination which is an AppSync Events API. If there are errors delivering these events to your Events API, they will be delivered to a DLQ where you can inspect what went wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new EventBus is created with a rule to catch events in your account which match a specified detail-type. These events are then sent to an API Destination which is an AppSync Events API. If there are errors delivering these events to your Events API, they will be delivered to a DLQ where you can inspect what went wrong. | |
A new EventBridge event bus is created with a rule to catch events in your account which match a specified detail-type. These events are then sent to an API Destination which is an AppSync Event API. If there are errors delivering these events to your Events API, they will be delivered to a dead-letter queue (DLQ) where you can inspect what went wrong. |
``` | ||
|
||
---- | ||
Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
|
||
## Testing | ||
|
||
### Set up your Events API to listen to events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Set up your Events API to listen to events | |
### Set up your Event API to listen to events |
## Testing | ||
|
||
### Set up your Events API to listen to events | ||
- Go to your pre-existing Events API in the console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Go to your pre-existing Events API in the console. | |
- Go to your pre-existing Event API in the AppSync console. |
|
||
**Check the Event Bus Name**: Ensure you are sending test messages to the correct event bus (name is in the outputs of the stack) with "detail type" of `serverless-patterns`. This example won't work on the default event bus. | ||
|
||
**Events not arriving to Events API Console**: Go to the SQS console, find the SQS queue created by this stack (which is your DLQ) and poll for messages. Any errors should be shown in the attributes tab of the messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Events not arriving to Events API Console**: Go to the SQS console, find the SQS queue created by this stack (which is your DLQ) and poll for messages. Any errors should be shown in the attributes tab of the messages. | |
**Events not arriving to Event API Console**: Go to the SQS console, find the SQS queue created by this stack (which is your DLQ) and poll for messages. Any errors should be shown in the attributes tab of the messages. |
|
||
**Events not arriving to Events API Console**: Go to the SQS console, find the SQS queue created by this stack (which is your DLQ) and poll for messages. Any errors should be shown in the attributes tab of the messages. | ||
|
||
**No messages in DLQ**: Double check that you have subscribed to the correct namespace/channel `default/serverless-patterns` in the Events API Console. Triple check you are sending messages to the correct event bus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**No messages in DLQ**: Double check that you have subscribed to the correct namespace/channel `default/serverless-patterns` in the Events API Console. Triple check you are sending messages to the correct event bus. | |
**No messages in DLQ**: Double check that you have subscribed to the correct namespace/channel `default/serverless-patterns` in the Event API Console. Triple check you are sending messages to the correct event bus. |
"link": "https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html" | ||
}, | ||
{ | ||
"text": "Amazon AppSync - Creating an Events API", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"text": "Amazon AppSync - Creating an Events API", | |
"text": "Amazon AppSync - Creating an Event API", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for your contribution. Your pattern will be merged to Serverlessland soon.
Issue #, if available: N/A.
Description of changes: Introducing a pattern which demonstrates how to send events from EventBridge to AppSync Events API, allowing consumers to receive events over WebSockets.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.