Using AWS ECS Fargate Horizontal Auto Scaling
Introduction In previous articles, I have provided instructions on using AWS ECS Fargate to deploy a NestJS Docker image utilizing S3 Service; you can review them to understand the basic concepts before proceeding. In this article, I will guide you through configuring auto scaling to automatically increase or decrease the number of instances based on demand. Prerequisites In the NestJS project, to easily test the auto-scaling feature, it is necessary to create an API with a relatively long processing time to drive CPU usage up during execution. I will create a simple API as follows for testing; you can add it to your project or replace it with any equivalent API of your choice. Afterward, build the Docker image and push it to AWS ECR. import { Controller , Get , ParseIntPipe , Query , } from '@nestjs/common' @ Controller ( 'test' ) export class TestController { @ Get ( 'sum' ) async sum (@ Query ( 'value' , ParseIntPipe ) value : number...