Amazon ECS allows you to run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster. This is called a service. If any of your tasks should fail or stop for any reason, the Amazon ECS service scheduler launches another instance of your task definition to replace it and maintain the desired count of tasks in the service depending on the scheduling strategy used.
In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind a load balancer. The load balancer distributes traffic across the tasks that are associated with the service.
Click here to learn more about ECS Services.
Task Definitions menu, select
awsbuilders-task-definition and then select
Actions and then select
Select the options below:
Also, insert the number
Number of tasks.
Rolling update and click on
Click here to learn more about Blue/Green deployment and ECS.
Select your default VPC and at least two subnets.
These are the subnets where your containers will be running.
This is for testing purposes only. In a production environment, you must use multilayered design to avoid exposing your containers.
Keep scrolling down - select
Application Load balancer and click on
EC2 Console to create a new load balancer.
Let’s create an
Application load balancer to be in front of your application.
awsbuilders-alb for the name and select
Also, select your default vpc and at least two subnets.
Next: Configure Security groups.
Create a new security group and then click on
Next: Configure Routing.
Create a new target group using the name
IP as a
Target Type and then click on
Next: Register targets.
Don’t add any target now and click on
Review the settings and click on
Create to deploy your Application Load Balancer.
Return to the ECS Service tab and refresh the load balancer list.
You should be able to select the newly created ALB.
Add to load balancer.
Now, you select the target group name
Move to the next step by clicking on
Finally, hit the button
Check if all steps are green and click on
View Service to open the new ECS Service.