Which solution will meet these requirements MOST cost-effectively?
Create an Amazon Machine Image (AMI) of the web application. Use the AMI to launch a second EC2 On-Demand Instance. Use an Application Load Balancer to distribute the load across the two EC2 instances.
Create an Amazon Machine Image (AMI) of the web application. Use the AMI to launch a second EC2 On-Demand Instance. Use Amazon Route 53 weighted routing to distribute the load across the two EC2 instances.
Create an AWS Lambda function to stop the EC2 instance and change the instance type. Create an Amazon CloudWatch alarm to invoke the Lambda function when CPU utilization is more than 75%.
Create an Amazon Machine Image (AMI) of the web application. Apply the AMI to a launch template. Create an Auto Scaling group that includes the launch template. Configure the launch template to use a Spot Fleet. Attach an Application Load Balancer to the Auto Scaling group.
Explanations:
While creating an AMI and launching a second EC2 instance with an Application Load Balancer (ALB) can help distribute the load, it does not provide automatic scaling capabilities to handle fluctuating traffic and would require manual intervention to scale further.
Similar to option A, using Route 53 weighted routing to distribute load does not provide automatic scaling. This method requires manual adjustments to the weights based on traffic and does not ensure high availability or cost-effectiveness.
This option involves a Lambda function to change the EC2 instance type based on CPU utilization, which is a reactive approach rather than a proactive scaling solution. It can lead to downtime and is not an efficient way to handle scaling needs during busy times.
This solution creates an Auto Scaling group using a launch template, which allows for automatic scaling based on demand. By using a Spot Fleet, it can also reduce costs while an Application Load Balancer ensures traffic is evenly distributed across instances. This approach meets the requirements for seamless scaling and cost-effectiveness.