Open michaelbrewer opened 2 years ago
Marking this as p2
for now, which means it is not in our immediate roadmap, until I see that enough people are searching for this feature. The workaround is to use a custom resource to do this for now.
Issue for tracking cloudformation support of this feature: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1215
The schema part is doable with CfnSchema. Still need a custom resource to ensure the registry exists
new eventSchemas.CfnSchema(scope, 'TestEventSchema', {
content: JSON.stringify({
components: {
examples: {
testEventName: {
value: {
foo: 'bar',
},
},
},
schemas: {},
},
info: { title: 'Event', version: '1.0.0' },
// eslint-disable-next-line spellcheck/spell-checker
openapi: '3.0.0',
paths: {},
}),
// eslint-disable-next-line spellcheck/spell-checker
registryName: 'lambda-testevent-schemas',
schemaName: `_${lambda.functionName}-schema`,
type: 'OpenApi3',
});
Description
Shareable test events is now available in the Lambda console. All you need to do it is setup an Amazon EventBridge schema registry called
lambda-testevent-schemas
and then create schemas with examples with the following naming convention_<YOUR_FUNCTION_NAME>-schema
.Use Case
Allows you to quickly populate shareable events on your
dev
,test
andstage
environmentsProposed Solution
From a UX point of view, we could simply things by just asking for the sample events you want to add ie:
And to be future proof also allow for a full schema definition.
This would use a CloudFormation Custom resource under the schemas to setup these test events (as well as ensure the required registry is created). In the future, hopefully official CloudFormation support will be coming.
A prototype for this exists here: Lambda shareable test events
Other information
Acknowledge