Book Image

Amazon Fargate Quick Start Guide

By : Deepak Vohra
Book Image

Amazon Fargate Quick Start Guide

By: Deepak Vohra

Overview of this book

Amazon Fargate is new launch type for the Amazon Elastic Container Service (ECS). ECS is an AWS service for Docker container orchestration. Docker is the de facto containerization framework and has revolutionized packaging and deployment of software. The introduction of Fargate has made the ECS platform serverless. The book takes you through how Amazon Fargate runs ECS services composed of tasks and Docker containers and exposes the containers to the user. Fargate has simplified the ECS platform. We will learn how Fargate creates an Elastic Network Interface (ENI) for each task and how auto scaling can be enabled for ECS tasks. You will also learn about using an IAM policy to download Docker images and send logs to CloudWatch. Finally, by the end of this book, you will have learned about how to use ECS CLI to create an ECS cluster and deploy tasks with Docker Compose.
Table of Contents (14 chapters)
Title Page
Copyright and Credits
Packt Upsell

Creating a task definition

In this section, we will create a task definition for a hello-world application using the tutum/hello-world Docker image. Another Docker image that exposes a HTTP port may also be used, but not all Docker images may be used. As an unsuitable example, the MySQL database Docker image, mysql, cannot be used with an application load balancer, as it exposes a TCP port, 3306. For an ECS task that exposes a TCP port, a network load balancer should be used.

  1. To create a new task definition, selectTask Definitionsin the ECS console, as shown in the following screenshot:
  1. In Task Definitions, click onCreate new Task Definition, as shown in the following screenshot:
  1. In Create newTask Definition, select Fargate as the launch type compatibility, as shown in the following screenshot. Scroll down and click on Next step:
  1. In Configure task and container definitions, specify a Task Definition Name (hello-world-task-definition) and select ecsTaskExecutionRole as the Task Role, as shown...