AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A media-streaming company is migrating about 100 stateless microservices from an on-premises Docker Swarm cluster to AWS. The engineering team wants to run the containers on Amazon ECS in a new three-AZ VPC. Business requirements are:
Keep day-to-day cluster maintenance to a minimum.
Reduce compute costs by running as many tasks as possible on Spot Instances, but every ECS service must always have at least one task on On-Demand capacity.
When Spot capacity is reclaimed, replacement infrastructure and tasks must launch automatically without manual action.
Which solution will satisfy these requirements while providing the least operational overhead?
Run the services on AWS Fargate using the FARGATE and FARGATE_SPOT capacity providers with weights of 1 and 4, respectively, and do not set a base value. Let ECS replace interrupted tasks as Spot capacity returns.
Create a single Auto Scaling group that uses a mixed-instances policy targeting 20 percent On-Demand and 80 percent Spot capacity. Attach the group to the cluster as one capacity provider and rely on the mixed policy to keep the On-Demand portion available.
Configure every service to use the EC2_SPOT launch type. Enable service auto scaling with the binpack placement strategy and rely on cluster auto scaling to launch new Spot Instances when tasks cannot be placed.
Create two Auto Scaling groups (one On-Demand, one Spot) and turn on managed scaling for each. Create an ECS capacity provider for each group, associate both providers with the cluster, and configure every ECS service with a capacity-provider strategy that sets base = 1 and weight = 1 for the On-Demand provider and weight = 4 for the Spot provider.
Using two Auto Scaling groups-one with On-Demand Instances and one with Spot Instances-lets you treat each purchase option as its own ECS capacity provider. By enabling managed scaling on both providers, Amazon ECS Cluster Auto Scaling automatically launches or terminates instances as tasks are scheduled, and the Auto Scaling groups themselves replace Spot Instances that are reclaimed.
Setting a capacity provider strategy that specifies base = 1 for the On-Demand provider guarantees that at least one task from each service is always placed on On-Demand capacity, while the weight values (for example, 1 for On-Demand and 4 for Spot) ensure that the remaining tasks are placed primarily on the Spot provider. The strategy therefore meets the availability requirement at the service level and maximizes cost savings.
The other options fail to meet one or more requirements:
A single mixed-instances Auto Scaling group cannot guarantee that each service keeps an On-Demand task because the ECS scheduler has no visibility into the 20 / 80 percent split inside the group.
Using Fargate and Fargate Spot with only weights provides no base guarantee; an interruption could leave a service temporarily without On-Demand capacity.
Configuring services to run only with the EC2_SPOT launch type violates the explicit requirement for an always-running On-Demand task and provides no purchase-option mix control at the service level.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is managed scaling in ECS capacity providers?
Open an interactive chat with Bash
What is the purpose of setting `base` and `weight` in a capacity-provider strategy?
Open an interactive chat with Bash
How does Amazon ECS handle Spot Instance interruptions?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Accelerate Workload Migration and Modernization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access