AWS Certified Solutions Architect Professional SAP-C02 Practice Question
Your company is modernizing an on-premises Java web application by containerizing it and deploying it on Amazon ECS with the EC2 launch type. The API is stateless and typically scales up to 15 tasks. To reduce compute cost, the architects want as many tasks as possible to run on Amazon EC2 Spot Instances while ensuring that at least two tasks always run on On-Demand Instances so the service remains available during Spot interruptions. The team also wants Application Auto Scaling target tracking on CPU utilization and wishes to minimize operational overhead. Which approach will meet these requirements MOST effectively?
Use AWS Fargate and Fargate Spot capacity providers. Configure the service so that the FARGATE_SPOT capacity provider has base = 2 and weight = 1, and omit the On-Demand provider so that additional tasks run on Spot capacity.
Create two Auto Scaling groups: one that runs only On-Demand Instances and one that runs only Spot Instances. Create a capacity provider for each group, associate both with the ECS cluster, and configure the service with a capacityProviderStrategy where the On-Demand capacity provider has base = 2, weight = 1 and the Spot capacity provider has weight = 4.
Configure the ECS service with the DAEMON scheduling strategy on an On-Demand Auto Scaling group, then add a separate Spot Auto Scaling group so extra tasks can be scheduled automatically across both groups.
Create a single Auto Scaling group that uses an EC2 MixedInstancesPolicy with 80 % Spot and 20 % On-Demand Instances, attach it to the ECS cluster, and set the service's launchType=EC2 without a capacity provider strategy.
The requirement is to combine Spot and On-Demand capacity while guaranteeing that two tasks always run on On-Demand Instances. Amazon ECS capacity providers let you attach an Auto Scaling group of On-Demand Instances and another of Spot Instances to the same cluster and assign each a capacityProviderStrategy at the service level. Setting base = 2 on the On-Demand capacity provider guarantees that the first two tasks are placed there, while assigning weight values (for example, weight 1 on On-Demand and weight 4 on Spot) directs all additional tasks to Spot Instances. This strategy continues to work with Application Auto Scaling because the service still scales the desired task count, and ECS Cluster Auto Scaling adjusts the underlying Auto Scaling groups.
The other options do not satisfy all constraints:
Using Fargate Spot with a base value on the Spot capacity provider cannot guarantee that the two mandatory tasks will stay on On-Demand capacity; the base must be set on the On-Demand provider, not on Spot, and the option as described misconfigures that.
The DAEMON scheduling strategy places exactly one task on each container instance and ignores the desired count, making it unsuitable for dynamic scaling or guaranteeing two On-Demand tasks.
An EC2 MixedInstancesPolicy in a single Auto Scaling group cannot assure that two specific tasks are always on On-Demand capacity, because the Spot/On-Demand split is applied to instances, not tasks, and Spot shortages could still remove all baseline capacity.
Therefore, creating separate capacity providers backed by distinct Auto Scaling groups and applying a capacityProviderStrategy with an On-Demand base of 2 is the most operationally efficient and reliable solution.
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 an Amazon ECS capacity provider?
Open an interactive chat with Bash
What does 'base' and 'weight' mean in a capacityProviderStrategy?
Open an interactive chat with Bash
Why can’t a single Auto Scaling group with a MixedInstancesPolicy guarantee On-Demand tasks?
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