29
loading...
This website collects cookies to deliver better user experience
const bus = new EventBus(this, 'inquisitorBus', {
eventBusName: 'inquisitorBus',
});
new CfnDiscoverer(this, 'inquisitorDisco', {
sourceArn: bus.eventBusArn,
description: 'Inquisitor Discoverer',
});
aws events put-events --entries '[{"Source": "mystore","DetailType": "Review Created","EventBusName":"inquisitorBus","Detail": "{\"star_rating\": 5, \"description\": \"The size and length fit me well and the design is fun. I felt very secure wearing this tshirt. \", \"helpful_count\": 34, \"unhelpful_count\": 1, \"pros\": [\"lightweight\",\"fits well\" ], \"cons\": [], \"customer\": {\"name\": \"Julian Wood\",\"email\": \"[email protected]\",\"phone\": \"+1 604 123 1234\" }, \"product\": {\"product_id\": 788032119674292922,\"title\": \"Encrypt Everything Tshirt\",\"sku\": \"encrypt-everything-tshirt\",\"inventory_id\": 23190823132,\"size\": \"medium\",\"taxable\": true,\"image_url\": \"https://img.mystore.test/encrypt-tshirt.jpg\",\"weight\": 200.0}}"}]'
aws events put-events --entries '[{"Source": "mystore","DetailType": "Review Updated","EventBusName":"inquisitorBus","Detail": "{\"star_rating\": 5, \"description\": \"The size and length fit me well and the design is fun. I felt very secure wearing this tshirt. \", \"helpful_count\": 34, \"unhelpful_count\": 1, \"pros\": [\"lightweight\",\"fits well\" ], \"cons\": [], \"customer\": {\"name\": \"Julian Wood\",\"email\": \"[email protected]\",\"phone\": \"+1 604 123 1234\" }, \"product\": {\"product_id\": 788032119674292922,\"title\": \"Encrypt Everything Tshirt\",\"sku\": \"encrypt-everything-tshirt\",\"inventory_id\": 23190823132,\"size\": \"medium\",\"taxable\": true}}"}]'
aws events put-events --entries '[{"Source": "myOtherStore","DetailType": "Review Created","EventBusName":"inquisitorBus","Detail": "{\"star_rating\": 5, \"description\": \"The size and length fit me well and the design is fun. I felt very secure wearing this tshirt. \", \"helpful_count\": 34, \"unhelpful_count\": 1, \"pros\": [\"lightweight\",\"fits well\" ], \"cons\": [], \"customer\": {\"name\": \"Julian Wood\",\"email\": \"[email protected]\",\"phone\": \"+1 604 123 1234\" }, \"product\": {\"product_id\": 788032119674292922,\"title\": \"Encrypt Everything Tshirt\",\"sku\": \"encrypt-everything-tshirt\",\"inventory_id\": 23190823132,\"size\": \"medium\",\"taxable\": true,\"image_url\": \"https://img.mystore.test/encrypt-tshirt.jpg\",\"weight\": 200.0}}"}]'
aws events put-events --entries '[{"Source": "mystore","DetailType": "Review Created","EventBusName":"inquisitorBus","Detail": "{\"star_rating\": 5, \"helpful_count\": 34, \"unhelpful_count\": 1, \"pros\": [\"lightweight\",\"fits well\" ], \"cons\": [], \"customer\": {\"name\": \"Julian Wood\",\"email\": \"[email protected]\",\"phone\": \"+1 604 123 1234\" }, \"product\": {\"product_id\": 788032119674292922,\"title\": \"Encrypt Everything Tshirt\",\"sku\": \"encrypt-everything-tshirt\",\"inventory_id\": 23190823132,\"size\": \"medium\",\"taxable\": true,\"image_url\": \"https://img.mystore.test/encrypt-tshirt.jpg\"}}"}]'
aws events put-events --entries '[{"Source": "mystore","DetailType": "Review Created","EventBusName":"inquisitorBus","Detail": "{\"helpful_count\": 34, \"unhelpful_count\": 1, \"customer\": {\"name\": \"Julian Wood\",\"email\": \"[email protected]\",\"phone\": \"+1 604 123 1234\" }, \"product\": {\"product_id\": 788032119674292922,\"sku\": \"encrypt-everything-tshirt\",\"inventory_id\": 23190823132,\"taxable\": true,\"image_url\": \"https://img.mystore.test/encrypt-tshirt.jpg\"}}"}]'
aws events put-events --entries '[{"Source": "mystore","DetailType": "Review Created","EventBusName":"inquisitorBus","Detail": "{\"helpful_count\": 34}"}]'
aws.schemas@SchemaCreated
and aws.schemas@SchemaVersionCreated
. The source of these events is aws.schemas
and the detail-types are SchemaCreated
and SchemaVersionCreated
... so if I subscribe to just the source using the default event bus you can get these notifications. The event payload looks like this:{
"version": "0",
"id": "f480b317-a12f-5ccc-89ac-2446862c329b",
"detail-type": "Schema Version Created",
"source": "aws.schemas",
"account": "359317520455",
"time": "2021-07-24T15:01:29Z",
"region": "us-east-1",
"resources": [
"arn:aws:schemas:us-east-1:359317520455:schema/discovered-schemas/mystore@ReviewCreated"
],
"detail": {
"SchemaName": "mystore@ReviewCreated",
"SchemaType": "OpenApi3",
"RegistryName": "discovered-schemas",
"CreationDate": "2021-07-24T15:01:19Z",
"Version": "5"
}
}
npm run generate-metadata-templates
command, but this step is optional. This uses the aws sdk to list all the schemas, retrieves them all as JSON, and extends them a bit. Nothing too special here... could be done as part of a lambda execution and saving to s3 and/or dynamodb. This step is so that you can take these templates and add your own notes manually.npm run build:<engine>
which in turn runs npm run generate
... which does similar stuff to generating the metadata templates. It also retrieves the schemas and extends them with some OpenAPI functionality. After that it runs everything through a parser to get it in the preferred engine's format. The project in general requires docker, but it looks like it's only for the slate and docuowl engines... which I don't want to use anyways.29