Installation
eventcatalog@2.6.0
Dual-license
The EventBridge plugin is a generator that can be used to generate your EventCatalog from an EventBridge registry.
You can map your schemas to services, domains and messages. You can also map all events from your registry into your catalog.
Installation
Run the following command to install the plugin.
npm i @eventcatalog/generator-eventbridge
Configuration
Configure the plugin in your eventcatalog.config.js
file.
Add the plugin to the generators
array.
import path from 'path';
import url from 'url';
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
export default {
title: 'OurLogix',
tagline: 'A comprehensive logistics and shipping management company',
organizationName: 'OurLogix',
homepageLink: 'https://eventcatalog.dev/',
landingPage: '',
editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
// By default set to false, add true to get urls ending in /
trailingSlash: false,
// Change to make the base url of the site different, by default https://{website}.com/docs,
// changing to /company would be https://{website}.com/company/docs,
base: '/',
// Customize the logo, add your logo to public/ folder
logo: {
alt: 'EventCatalog Logo',
src: '/logo.png',
text: 'OurLogix',
},
docs: {
sidebar: {
// Should the sub heading be rendered in the docs sidebar?
showPageHeadings: true,
},
},
generators: [
[
'@eventcatalog/generator-eventbridge',
{
region: 'us-east-1',
registryName: 'discovered-schemas',
services: [
// Maps exact events to the service
{ id: 'Orders Service', version: '1.0.0', sends: [{ detailType: ['OrderPlaced', 'OrderUpdated'], eventBusName: 'orders'}], receives:[{ detailType: "InventoryAdjusted", eventBusName: 'inventory'}] },
// Filter by source (all events that match the source get assigned). This example shows any event matching the source
// "myapp.orders" will be assigned to the inventory service. The inventory service will publish these events.
{ id: 'Inventory Service', version: '1.0.0', sends: [{ source: "myapp.orders", eventBusName: 'orders'}], receives:[{ detailType: "UserCheckedOut", eventBusName: 'inventory'}] },
// This service sends events that match the SchemaName prefixing myapp, and will receive events that end with Payment
// this also does not map any event buses to your events
{ id: 'Payment Service', version: '1.0.0', sends: [{ prefix: "myapp"}], receives:[{ suffix: "Payment" }] }
],
// all services are mapped to this domain
domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
},
],
// Just import all events into the Catalog from a registry
[
'@eventcatalog/generator-eventbridge',
{
region: 'us-east-1',
registryName: 'discovered-schemas'
},
],
// Example using optional credentials
[
'@eventcatalog/generator-eventbridge',
{
region: 'us-east-1',
registryName: 'discovered-schemas',
credentials: {
accessKeyId: 'X',
secretAccessKey: 'X',
accountId: 'X',
},
},
],
],
};
Configure license key
The EventBridge plugin requires a license key to work with EventCatalog.
You can get a 14 day trial license key to try the plugin out by going to EventCatalog Cloud.
You have a few options for setting the license key:
1. Setting license key in .env
file (recommended)
eventcatalog@2.35.4
Create a .env
file in the root of your project and add the following:
EVENTCATALOG_LICENSE_KEY_EVENTBRIDGE=your-license-key
If you are using an older version of EventCatalog that does not support the .env
file, you can just export the license key as an environment variable.
export EVENTCATALOG_LICENSE_KEY_EVENTBRIDGE=your-license-key
2. Setting license key in eventcatalog.config.js
If you prefer, you can set the license key in the eventcatalog.config.js
file
using the licenseKey
property in the EventCatalog EventBridge plugin.
export default {
generators: [
[
'@eventcatalog/generator-eventbridge',
{
licenseKey: '[INSERT_YOUR_LICENSE_KEY]', // or process.env.EVENTCATALOG_LICENSE_KEY_EVENTBRIDGE
region: 'us-east-1',
registryName: 'discovered-schemas'
},
],
],
};
White listing EventCatalog domains
If you are behind a firewall you will need to white list the domain https://api.eventcatalog.cloud
in your firewall. This is because the plugin needs to verify your license key.
Run the plugin
This command will run the generators in your eventcatalog.config.js file.
npm run generate
View your catalog
Run your catalog locally to see the changes
npm run dev
AWS Configuration
Policy for AWS
This plugin will require some read access to your Schema Registry and Versions.
It's recommended you create a new IAM user with the following policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EventCatalog",
"Effect": "Allow",
"Action": [
"schemas:ExportSchema",
"schemas:SearchSchemas",
"schemas:ListSchemas",
"schemas:ListSchemaVersions",
"schemas:DescribeSchema",
"schemas:GetDiscoveredSchema"
],
"Resource": "*"
}
]
}
Commercial and License
This plugin requires a license key to be used.
You can get a 14 day trial license key to try the plugin out by going to EventCatalog Cloud.
After the trial you can purchase a license to continue using this plugin, we have different plans to suit your organization.
See pricing for more information.
Have any questions? You can email us at hello@eventcatalog.dev
.
License FAQ
What is the license key for?
The license key is required to use the OpenAPI plugin with EventCatalog. It helps support ongoing development and maintenance of the plugin and project.
How do I get a license key?
You can obtain a license key by visiting EventCatalog Cloud. New users can start with a 14-day free trial.
Terms
- Trial Period: 14 days free trial no credit card required
- Support: Discord community support (extra for priority support)
After your trial period ends, you can purchase a full license through EventCatalog Cloud to continue using the plugin.
Issues
If you have any problems or feature requests please feel free to raise them on GitHub. https://github.com/event-catalog/generators