0
0
AWScloud~20 mins

CloudWatch Events (EventBridge) in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
EventBridge Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens when a CloudWatch Event rule targets a Lambda function with a dead-letter queue configured?

You have a CloudWatch Event rule that triggers a Lambda function. The Lambda function has a dead-letter queue (DLQ) configured. What is the behavior when the Lambda function invocation fails?

AThe event is retried twice and then sent to the DLQ if still failing.
BThe event is retried indefinitely until the Lambda function succeeds, ignoring the DLQ.
CThe event is discarded immediately without sending to the DLQ or retrying.
DThe failed event is sent to the DLQ for later analysis and the event is not retried automatically.
Attempts:
2 left
💡 Hint

Think about how Lambda handles failures with DLQ configured in asynchronous invocation.

Architecture
intermediate
2:00remaining
Which architecture best ensures exactly-once processing of events using EventBridge and SQS?

You want to design an architecture using EventBridge and SQS to ensure that each event is processed exactly once by your application. Which setup achieves this?

AEventBridge rule sends events to an SQS FIFO queue, and the application reads from the queue with message deduplication enabled.
BEventBridge rule sends events to a standard SQS queue, and the application deletes messages after processing.
CEventBridge rule sends events directly to Lambda with retries enabled to ensure no event loss.
DEventBridge rule sends events to SNS topic which fans out to multiple SQS queues for parallel processing.
Attempts:
2 left
💡 Hint

Consider which SQS queue type supports deduplication and ordering to avoid duplicate processing.

security
advanced
2:00remaining
What IAM permission is required for an EventBridge rule to invoke a Lambda function?

To allow an EventBridge rule to invoke a Lambda function, which IAM permission must be granted?

A"events:PutEvents" permission granted to the Lambda function role.
B"lambda:InvokeFunction" permission granted to the EventBridge service principal on the Lambda function resource.
C"lambda:CreateEventSourceMapping" permission granted to the EventBridge rule.
D"events:InvokeFunction" permission granted to the Lambda function resource.
Attempts:
2 left
💡 Hint

Think about what permission allows a service to call a Lambda function.

Configuration
advanced
2:00remaining
Which EventBridge rule pattern matches events from EC2 instance state changes to 'stopped' or 'terminated'?

Choose the correct EventBridge event pattern JSON that matches EC2 instance state changes when the state is either 'stopped' or 'terminated'.

A
{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": {
    "state": {"equals": ["stopped", "terminated"]}
  }
}
B
{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": {
    "state": "stopped,terminated"
  }
}
C
{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": {
    "state": ["stopped", "terminated"]
  }
}
D
{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": {
    "state": ["stopped"],
    "state": ["terminated"]
  }
}
Attempts:
2 left
💡 Hint

Remember the syntax for matching multiple values in an array for a key in EventBridge event patterns.

Best Practice
expert
2:00remaining
What is the best practice to avoid event loss when using EventBridge with multiple targets?

You have an EventBridge rule with multiple targets including Lambda, SQS, and SNS. To avoid losing events if one target fails, what is the best practice?

AConfigure EventBridge to batch events and send them only once per minute to reduce failures.
BSend events only to Lambda and rely on Lambda retries to handle failures for other services.
CUse a single SNS topic as the target and subscribe all services to it to centralize event delivery.
DConfigure a dead-letter queue (DLQ) for each target and enable retry policies on the EventBridge rule.
Attempts:
2 left
💡 Hint

Think about how to handle failures per target and ensure events are not lost.