A developer needs to run a short Python script for 10 seconds every night to clean up temporary database records. The developer does not want to provision or manage any virtual servers. Which AWS compute service should be used to run this script?
- AWS LambdaAnswer
- BAmazon EC2
- CAmazon Lightsail
- DAmazon ECS
Answer
AWS Lambda
The correct option is AWS Lambda because it is a serverless compute service that runs code only when triggered (such as by a cron schedule) and automatically handles the underlying compute infrastructure, freeing the developer from server management.
Step-by-Step Solution
Key Concept
AWS Lambda allows users to run code as serverless functions, eliminating the need to provision or manage servers while automatically scaling and only charging for active compute time.