EventsGate "Tiny edition" is a solution for debugging and monitoring events across all EventBridge buses in your AWS account.
This stack creates an EventBridge rule that captures all events from a specified event bus (or the default bus if none is specified) and stores them in a dedicated CloudWatch Log Group.
By centralizing events into a single log group, this solution simplifies troubleshooting, auditing, and debugging workflows across your AWS environment.
This is a PoC for a slightly larger product for dinamically monitoring all your event buses from a CLI (or maybe a full GUI) tool. If interested you should check out the aws-events-gate repo
Following a brief guide about how to use this tool
You can deploy this tool multiple time for the same account, attaching an events gate to each event bus you need to monitor.
The deployment is available through multiple IaC tools, feel free to pick your fav 💕.
Please, reference the section Launch on your account
for info about how to deploy the tool.
-
Log into your AWS Account and search for the
Amazon Cloudwatch
service. -
From the side bar menu, search and navigates into
Logs > Log Groups
. -
Use the search bar to look up for a cloudwatch group formatted like this
EventsGate/<your-event-bus>/watch
-
Click on the desired log group
Once inside the Cloudwatch log group you can either look at past events still retained (look at the retention period. It should be 1 Day by default), or snif events passing through the gate on the go.
You can leverage the Start Tailing
button to look at events in realtime as they come:
Congrats 🎉 You are now ready to use EventsGate Tiny
The project comes with different options for deployment in your account.
-
AWS Account with permissions to create EventBridge and CloudWatch resources.
-
AWS CLI installed and configured with credentials.
To launch with cdk you will need additional libraries:
- Node and a package manager (example: pnpm)
Furthermore, your account should be bootstrapped for using CDK. More here.
Once everything is set, do the following:
- Go to
cdk
folder - Install dependencies
pnpm i
- Run the deploy commmand passing the bus to monitor as context variable:
If no
pnpm cdk deploy -c bus=<your_event_bus>
bus
is provided then the default bus will be used.
You can apply custom tags to resources by adding a .tags.json
. For more info read this doc.
To launch with tofu you will need additional libraries:
- Tofu
You can use
- Go to
tofu
folder - Initialize the backend with:
tofu init
- Apply using your own
.tfvars
file:You can set thetofu apply --var-file="vars.tfvars"
eventbus_name
in the .tfvars file. If nobus
is provided then the default bus will be used.
You can apply custom tags to resources by using the tags
variables in the tfvars
The provided solution is mainly based on serverless components, therefore the costs should be relatively low, especially if used for debugging with low traffic event buses.
Nevertheless, the main elements of cost to keep under control to avoid excessive spendings are:
- Number of events passing through the monitored bus
- Amount of data stored in Amazon Cloudwatch. Please note that default settings only store the received events as logs for 1 Day
This tool is (currently) made and maintained with 💜 by aka-somix. For any bug or feature request feel free to open a Issue in the dedicated section of this repository.
The solution is based on a reference architecture documented and available on Serverless Land