Question #950
A company operates a production application on Amazon ECS using AWS Fargate. To optimize costs, the company wants to integrate FARGATE_SPOT capacity providers into their existing Fargate setup while ensuring high availability. A developer must configure the ECS cluster's capacity provider strategy to minimize downtime during the transition. Which solution meets these requirements?
Use the PutClusterCapacityProviders API operation to update the ECS cluster with the FARGATE and FARGATESPOT capacity provider strategies. Set FARGATE as the default provider with a base value and FARGATESPOT as the secondary provider for cost optimization.
Use the CreateCapacityProvider API operation to associate the ECS cluster with the FARGATE and FARGATESPOT capacity provider strategies. Configure FARGATE as the primary provider with a base value and FARGATESPOT as the secondary provider.
Use the PutClusterCapacityProviders API operation to update the ECS cluster with the FARGATESPOT and FARGATE capacity provider strategies. Set FARGATESPOT as the default provider for maximum cost savings and FARGATE as the failover provider.
Use the CreateCapacityProvider API operation to associate the ECS cluster with the FARGATESPOT and FARGATE capacity provider strategies. Configure FARGATESPOT as the primary provider and FARGATE as the secondary provider.
Explanation
Answer A is correct because:
1. PutClusterCapacityProviders API: This operation updates an existing ECS cluster's capacity providers, which is required to integrate FARGATESPOT into the current setup.
2. Base Value for FARGATE: Setting FARGATE as the default provider with a base ensures a minimum number of tasks run on reliable on-demand capacity, preventing downtime if FARGATESPOT capacity is unavailable.
3. FARGATESPOT as Secondary: This allows cost optimization by using Spot capacity for non-critical tasks while maintaining high availability.
Other options are incorrect because:
- B & D: The CreateCapacityProvider API is used to create new capacity providers, not associate existing ones (FARGATE/FARGATESPOT are managed by AWS).
- C: Prioritizing FARGATESPOT as the default risks downtime if Spot capacity is unavailable, violating the high-availability requirement.
Key Points: Use PutClusterCapacityProviders to update strategies; prioritize FARGATE with a base for stability, then FARGATESPOT for cost savings.
Answer
The correct answer is: A