Easy1 markMultiple Choice
Domain 4.2: Compute Cost OptimizationLambdaEventBridgeCost Optimization

AWS SAA-C03 · Question 60 · Domain 4.2: Compute Cost Optimization

A company has a script that runs for 5 minutes every night at midnight to clean up database records. Currently, the script runs on a t3.micro EC2 instance that is left running 24/7.<br/><br/>What is the MOST cost-effective way to run this script?

Answer options:

A.

Purchase a Reserved Instance for the t3.micro.

B.

Use an Auto Scaling group to start the EC2 instance at midnight and terminate it at 12:10 AM.

C.

Migrate the script to an AWS Lambda function and trigger it using an Amazon EventBridge scheduled rule.

D.

Run the script on AWS Fargate.

How to approach this question

Identify the serverless compute option for short-running, scheduled tasks.

Full Answer

C.Migrate the script to an AWS Lambda function and trigger it using an Amazon EventBridge scheduled rule.✓ Correct
AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. You pay only for the compute time you consume. Triggering it via EventBridge (formerly CloudWatch Events) is the standard way to run cron jobs in AWS.

Common mistakes

Trying to optimize the EC2 instance instead of moving to a serverless architecture.

Practice the full AWS SAA-C03 Practice Exam 6

65 questions · hints · full answers · grading

More questions from this exam