AWS Certified Developer – Associate (DVA-C02) — Question 152
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 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 can be configured to trigger Lambda functions on a regular schedule, making it fully automated and serverless. Option A is incorrect as it requires managing an EC2 instance, which defeats the serverless approach. Option B does not invoke the function but merely sets a variable, and option D involves SNS, which is not designed for scheduled invocations.