Q16 — AWS SAA-C03 Ch.5
Question 16 of 65 | ← Chapter 5
Q316. A company runs a Java-based job on an Amazon EC2 instance.The job runs every hour and takes 10 seconds to run.The job runs on a scheduled interval and consumes 1 GB of memory. The CPU utilization of the instance is low except for short surges during which the job uses the maximum CPU available. The company wants to optimize the costs to run the job.Which solution will meet these requirements?
- A. Use AWS App2Container (A2C) to containerize the job. Run the job as an Amazon Elastic Container Service (Amazon ECS) task on AWS Fargate with 0.5 virtual CPU(vCPU) and 1GB of memory
- B. Copy the code into an AWS IAMbdafunction that has 1 GB of memory. Create an Amazon EventBridge scheduled rule to run the code each hour ✓
- C. Use AWS App2Container (A2C) to containerize the job.Install the container in the existing Amazon Machine Image (AMl). Ensure that the schedule stops the container when the task finishes
- D. Configure the existing schedule to stop the EC2 instance at the completion of the job and restart the EC2 instance when the next job starts
Correct Answer: B. Copy the code into an AWS IAMbdafunction that has 1 GB of memory. Create an Amazon EventBridge scheduled rule to run the code each hour
Explanation
AWS Lambda automatically scales resources to handle the workload, so you don't have to worry about managing the underlying infrastructure. It provisions the necessary compute resources based on the configured memory size (1 GB in this case) and executes the job in a serverless environment.By using Amazon EventBridge, you can create a scheduled rule to trigger the Lambda function every hour, ensuring that the job runs on the desired interval.