This is a repo to illustrate the ability to publish events to EventBridge by writing to the lambda log. The details of the approach are covered here
The CDK stack to create the two lambdas, an event bus and subscription filter:
The lambda that writes to the log:
The lambda that is triggered by the CloudWatch Subscription Filter and publishes the Event to Event Bridge:
This uses the CDK to deploy the infrastructure. You can install the CDK here
npm install
cdk deploy
If you have Speedrun installed and enabled on this repository and have configured it with a role that allows you to invoke lambdas, you can invoke the messenger lambda with:
#!lambda
~~~functionUrl=Function URL{suppress: true}~~~
{
"message": ~~~Message {transform: 'JSON.stringify(value)'}~~~
}
The function url will be printed in the output of the CDK deploy command.
npm install
get all of the packagescdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template