ECS - Elastic Container Service ๐Ÿ”ฅ

ยท

2 min read

What is ECS?

ECS (Elastic Container Service) is a fully-managed container orchestration service provided by Amazon Web Services (AWS). It allows you to run and manage Docker containers on a cluster of virtual machines (EC2 instances) without having to manage the underlying infrastructure.

With ECS, you can easily deploy, manage, and scale your containerized applications using the AWS Management Console, the AWS CLI, or the API. ECS supports both "Fargate" and "EC2 launch types", which means you can run your containers on AWS-managed infrastructure or your own EC2 instances.

ECS also integrates with other AWS services, such as Elastic Load Balancing, Auto Scaling, and Amazon VPC, allowing you to build scalable and highly available applications. Additionally, ECS has support for Docker Compose and Kubernetes, making it easy to adopt existing container workflows.

Overall, ECS is a powerful and flexible container orchestration service that can help simplify the deployment and management of containerized applications in AWS.

Set up ECS (Elastic Container Service) by setting up Nginx on ECS

  1. Create an ECS cluster:

In the ECS service, click on "Create Cluster".

Create a task definition:

Find an Nginx image in the Amazon ECR public gallery and copy the image's URL.

Create a service:

In the ECS, click on "Clusters", and select the cluster that you created

Configure the service settings, such as the VPC, subnet, and security group settings. Establish a new security group

Configure HTTP port mappings with port 80.

Click on 'Create'.

The service was successfully created.

Once the ECS service is running, test the Nginx container by accessing the public IP address of the Fargate task in a web browser. The public IP address can be found in the ECS service's "Tasks" tab, under the "Configuration" section.

Test the Nginx container:

Click on the "cluster" that you created.

Click on 'Task'.

In the task, go to the 'configuration' section, there you can find public IP.

If you browse the public IP address, you can see the default Nginx welcome page.


ย