Search code examples
amazon-web-servicesamazon-ecsaws-fargate

Launch Type vs. Capacity Provider Strategy for Fargate Service


I have a Fargate service running using NetworkLoadBalancedFargateService from the CDK, and am currently trying to configure autoscaling for the service. When looking at my service through the ECS console, I see that the tasks running under it have "Fargate" as the launch type. Since it uses launch type, there's no way to specify a capacity provider strategy (from note in AWS docs). I've read a bit about capacity providers, and I'm not sure I actually need to worry about them. As far as I can tell, you can define a capacity provider strategy to specify a split between different capacity providers. For Fargate, the capacity provider choices are FARGATE and FARGATE_SPOT. For my service, I would want only FARGATE providers. Is there a difference between using the Fargate launch type and using a capacity provider strategy that's 100% FARGATE? Is there even a way to specify a capacity provider strategy for your tasks through the CDK?


Solution

  • Corresponded with someone from AWS who confirmed that there is no difference between launching a service using the Fargate launch type vs. using 100% FARGATE type capacity providers. Thus, it isn't necessary to add capacity providers to your cluster if you don't plan on using FARGATE_SPOT. Simply using the Fargate launch type is sufficient.