Skip to content

Registry

Source: src/AWS/Schemas/Registry.ts

An EventBridge Schema Registry — a named collection of event schemas. Custom registries hold your own OpenAPI 3 / JSONSchema Draft 4 schema documents; AWS also maintains the built-in aws.events and discovered-schemas registries.

Basic Registry

const registry = yield* AWS.Schemas.Registry("app-events", {
description: "Schemas for application events",
});

Registry with Tags

const registry = yield* AWS.Schemas.Registry("orders", {
description: "Order lifecycle events",
tags: { team: "payments" },
});
const registry = yield* AWS.Schemas.Registry("shared-events", {
policy: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: { AWS: `arn:aws:iam::${otherAccountId}:root` },
Action: ["schemas:DescribeRegistry", "schemas:SearchSchemas"],
Resource: registryArn,
},
],
},
});
const registry = yield* AWS.Schemas.Registry("app-events", {});
const schema = yield* AWS.Schemas.Schema("OrderCreated", {
registryName: registry.registryName,
type: "OpenApi3",
content: JSON.stringify(openApiDocument),
});