Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brianfoody
Last active August 24, 2020 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianfoody/1cb11418a88eb79c11335495f22e69d6 to your computer and use it in GitHub Desktop.
Save brianfoody/1cb11418a88eb79c11335495f22e69d6 to your computer and use it in GitHub Desktop.
Create EventBridge Schema from TypeScript
import * as schemas from "@aws-cdk/aws-eventschemas";
import * as cdk from "@aws-cdk/core";
import { generateOpenApiSchema } from "./generators/schemaGenerator";
...
this.schema = new schemas.CfnSchema(this, "MySchema", {
registryName: props.mlRegistry.attrRegistryName,
type: "OpenApi3",
description: "Schema Definition for my events",
content: JSON.stringify(generateOpenApiSchema("OrgEvents", "1.0.0")),
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment