Applying EventBridge Automation Patterns
This lesson explains the EventBridge patterns that repeatedly appear in operations questions, connecting AWS events to automated responses, and how to choose the target.
Learning outcomes
After completing this lesson, you will be able to:
- Recognise common automation patterns.
- Choose the target with the least custom code.
- Design automated responses that are safe.
- Schedule actions with EventBridge Scheduler.
Common patterns
Most operational automation follows a small number of patterns. Each starts from an event that an AWS service publishes on the default event bus, such as a state change, a finding or a scheduled health event, and ends with a target that notifies people or changes resources. Recognising the pattern in a scenario usually identifies the event source and the most suitable target. The following table lists the common patterns with the usual target.
| Trigger event | Automation | Target |
|---|---|---|
| EC2 Instance State-change (stopped) | Restart or notify | Systems Manager Automation or SNS |
| AWS API Call via CloudTrail (RunInstances, CreateBucket) | Tag, validate or remediate new resources | Lambda |
| Config Rules Compliance Change | Fix non-compliant resource | Systems Manager Automation |
| AWS Health Event (scheduled change) | Plan maintenance, stop/start | SNS, Automation |
| GuardDuty Finding (high severity) | Isolate instance, notify | Step Functions or Automation |
| Auto Scaling lifecycle action | Configure or drain an instance | Lambda or Automation |
| ECS Task State Change (STOPPED with error) | Record and alert | CloudWatch Logs, SNS |
| Schedule (EventBridge Scheduler) | Stop dev instances nightly, run reports | Automation, Lambda, universal targets |
Choosing the target
Prefer the target that requires the least custom code. Systems Manager Automation runbooks suit AWS-centric procedures with audit trails and approvals. Lambda suits short custom logic under 15 minutes. Step Functions suits long-running, multi-step or branching workflows with waits, retries and human approval. SNS and SQS suit notification and buffering. EventBridge Scheduler with universal targets can call almost any AWS API directly, such as ec2:StopInstances, with no function at all.
Which target?
Designing safe automated responses
Automation that acts on production resources must be designed so that it cannot cause more harm than the event it responds to. The event pattern should be as specific as possible, matching the exact source, detail type and resource attributes, so that the rule does not fire for unrelated events. Actions should be idempotent, producing the same result if an event is delivered twice, because EventBridge delivers at least once.
A common failure is an automation loop: a rule reacts to a change, its target makes another change of the same kind, and that change triggers the rule again. Loops are avoided by excluding the automation's own role in the event pattern, by matching only the specific change that needs fixing, or by checking the current state before acting. Destructive or high-impact actions, such as terminating instances or revoking access, can include an approval step in an Automation runbook or a Step Functions workflow, and every automated action should be logged and notified so that operators know what changed.
The following diagram shows a loop and the two design rules that prevent it.

Runaway automation
Stopping development instances at night
A company wants all EC2 instances tagged Env=dev stopped at 20:00 and started at 07:00 on weekdays in the London time zone. The operator creates two EventBridge Scheduler schedules with cron expressions and the Europe/London time zone, each targeting the Systems Manager Automation runbooks AWS-StopEC2Instance and AWS-StartEC2Instance with the tag as the target and a rate control of 20%. An alternative, the AWS Instance Scheduler solution, offers more scheduling features but requires deploying and maintaining a solution stack.
Which target suits a long, multi-step workflow with retries and waits?
Show answer
AWS Step Functions. Lambda suits short custom logic, and Automation suits auditable AWS procedures.
Exam Tips
Remember for the exam
- Match the trigger event to the simplest capable target.
- Use Automation for auditable AWS procedures, Lambda for short custom logic, Step Functions for long workflows.
- EventBridge Scheduler universal targets call AWS APIs without code.
- Config compliance changes and Health events are common automation triggers.