Create an EventBridge rule with SNS topic as target which has a Lambda function as subscription.
This Terraform code deploys an EventBridge rule with an SNS topic target which has a Lambda function as a subscriber and the IAM permissions required to run the application. Whenever the EventBridge rule gets triggered, the Lambda function is invoked by the SNS topic. It also deploys the resources and the IAM permissions required to run the application.
In this example, the EventBridge rule specified in `main.tf` filters the events based upon the criteria in the `aws_cloudwatch_event_rule` block. When matching events are sent to EventBridge that trigger the rule, they are delivered as a JSON event payload to the SNS topic.
The SNS topic further invokes and delivers the message payload to the subscribed Lambda function defined in the `aws_lambda_function` block.