AWS Certified Developer – Associate — Question 145
A developer is writing a serverless application that requires an AWS Lambda function to be invoked every 10 minutes.
What is an automated and serverless way to invoke the function?
Answer options
- A. Deploy an Amazon EC2 instance based on Linux, and edit its /etc/crontab file by adding a command to periodically invoke the Lambda function.
- B. Configure an environment variable named PERIOD for the Lambda function. Set the value to 600.
- C. Create an Amazon EventBridge (Amazon CloudWatch Events) rule that runs on a regular schedule to invoke the Lambda function.
- D. Create an Amazon Simple Notification Service (Amazon SNS) topic that has a subscription to the Lambda function with a 600-second timer.
Correct answer: C
Explanation
The correct answer is C because Amazon EventBridge allows for scheduled events to trigger AWS Lambda functions in a serverless manner. Option A involves using an EC2 instance, which contradicts the serverless requirement, while option B does not trigger the function automatically. Option D relies on SNS, which is not designed for periodic invocation but rather for event-driven messaging.