EDA is a software design pattern in which the flow of the system is determined by events rather than a central control flow. In EDA, the system responds to events that occur asynchronously, such as messages received from AWS services, custom events, or even third-party Software as a Service (SaaS) applications.
An event-driven system consists of three main components:
EDA has the following advantages:
With a basic understanding of how the EventBridge service works, you are now ready to examine how to use targets by combining the Lambda and SNS services and Amazon EventBridge.
In Chapter 5, Managing Your Environment with AWS Config, you looked at how AWS Config could be used to record and track changes to your infrastructure as soon as they happen and how these events can be written to logs and processed into other services, such as Amazon CloudWatch. Using this data, you can configure controls to look for specific events for further investigation. These could be events that might signify a security breach or a threat.
This is a simple method of implementing an automated level of remediation by monitoring and identifying events from different services to look for potential security breaches and implementing an automated response using AWS Lambda to rectify the problem. In addition to CloudWatch log groups, you can use Amazon EventBridge to trigger a service such as Lambda to provide the remediation or fix for the issue discovered in the CloudWatch log group.
To briefly recap, AWS Lambda is a serverless compute service that automatically provisions compute power, allowing you to run code for your applications either on-demand or in response to events without having to provision any compute resources yourself. Using this serverless technology removes a level of administrative responsibility of maintaining a compute instance; instead, that is all managed by AWS. This allows you to focus purely on the application and logic code.
Removing the need to provision and run an EC2 instance can provide significant cost savings as, when using AWS Lambda, it only charges you for the compute power per 100 ms of use when your code is running, in addition to the number of times your code is run.
EventBridge events can be used to react to specific events within your infrastructure, which can trigger an automated response.