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
Contributors
Preface
Index

Configuring ECS specific parameters


We also need to create an ECS specific parameters file, ecs-params.yml, which defines resource (CPU and memory) settings for the task to create in addition to setting the Network Mode as awsvpc, which is the only supported Network Mode for the Fargate launch type. The run parameters include the network configuration for subnets, security groups, and setting the Assign public IP option for the task toENABLED. The subnets are obtained from the output of the ecs-cli up command. The security group is obtained from the output of the Get-EC2SecurityGroup -Region "us-east-1" -GroupId $groupid command, as listed earlier:

version: 1
task_definition:
  task_execution_role: ecsExecutionRole
  ecs_network_mode: awsvpc
  task_size:
    mem_limit: 0.5GB
    cpu_limit: 256
run_params:
  network_configuration:
    awsvpc_configuration:
      subnets:
        - "subnet-2c02dd4b"
        - "subnet-f2d50bdc"
      security_groups:
        - "sg-8c7dafc7"
      assign_public_ip...