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.
Creating a Registry
Section titled “Creating a Registry”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" },});Sharing a Registry
Section titled “Sharing a Registry”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, }, ], },});Adding Schemas
Section titled “Adding Schemas”const registry = yield* AWS.Schemas.Registry("app-events", {});const schema = yield* AWS.Schemas.Schema("OrderCreated", { registryName: registry.registryName, type: "OpenApi3", content: JSON.stringify(openApiDocument),});