Which of the following is the correct JSON snippet to create a CloudWatch Events rule that triggers every 5 minutes?
easy📝 Configuration Q12 of 15
AWS - CloudWatch
Which of the following is the correct JSON snippet to create a CloudWatch Events rule that triggers every 5 minutes?
A{"ScheduleExpression": "rate(5 minute)"}
B{"ScheduleExpression": "cron(0/5 * * * ? *)"}
C{"ScheduleExpression": "rate(5 min)"}
D{"ScheduleExpression": "cron(5 * * * ? *)"}
Step-by-Step Solution
Solution:
Step 1: Understand schedule syntax
EventBridge supports rate and cron expressions. For 5-minute intervals, cron syntax is cron(0/5 * * * ? *).
Step 2: Check each option
{"ScheduleExpression": "rate(5 minute)"} uses rate(5 minute) which is invalid syntax (must use 'minutes' plural). {"ScheduleExpression": "cron(0/5 * * * ? *)"} uses correct cron syntax for every 5 minutes. {"ScheduleExpression": "rate(5 min)"} uses 'min' which is invalid. {"ScheduleExpression": "cron(5 * * * ? *)"} triggers at minute 5 every hour, not every 5 minutes.
Final Answer:
{"ScheduleExpression": "cron(0/5 * * * ? *)"} -> Option B
Quick Check:
Cron for every 5 minutes = D [OK]
Quick Trick:Use cron(0/5 * * * ? *) for every 5 minutes [OK]
Common Mistakes:
MISTAKES
Using 'min' instead of 'minutes' in rate expressions
Confusing cron syntax for intervals
Using rate with incorrect pluralization
Master "CloudWatch" in AWS
9 interactive learning modes - each teaches the same concept differently