At AWS re:Invent 2017, a new launch type for containers called Fargate was announced. This book is about Amazon Fargate, the new launch type for the Amazon Elastic Container Service (ECS) for Docker containers.
Docker is the de factostandard containerization framework that has revolutionized packaging and deployment of software. Amazon Fargate has made the ECS platform serverless; no EC2 instances to provision, run, or manage. Amazon Fargate runs ECS services on Docker containers and exposes the service tasks directly to the user. Fargate has much simplified the ECS platform by making it serverless.
Amazon Fargate provides the following benefits:
- It's supported on AWS ECS, with support to be added on AWS EKS
- It's fully integrated with the other AWS services, including IAM, CloudWatch Logs, and EC2 Load Balancing
- Amazon Fargate is serverless and reduces management of ECS clusters; no EC2 instances to provision, create, or manage
- ECS service tasks are directly exposed to user
- An Elastic Network Interface is created for each task
- There's support for the auto scaling of ECS tasks
- An ECS CLI is provided to create ECS clusters and deploy tasks with Docker Compose
Instead of launching ECS clusters on EC2 instances, Amazon Fargate launches clusters on the Fargate platform.
The primary audience is Docker users and developers. Also, if you occupy any of the following roles, you will find this book useful:
- DevOps architect
- Docker specialist
- DevOps engineer (Docker)
Chapter 1, Getting Started with Amazon ECS and Amazon Fargate, is an introductory chapter in which we discuss the benefits of using the Fargate launch type, how compute resources are distributed and configured with Fargate launch type, the ECS objects in Fargate that are the same as for the EC2 launch type, and the new features in Fargate.
Chapter 2, Networking, introduces the Fargate launch type as used with an ECS cluster. We will create a cluster, including container, task, and service definitions, using a Hello World Docker image. Subsequently, we will invoke the Hello World application using the IPv4 Public IP of the Elastic Network Interface associated with a task.
Chapter 3, Using CloudWatch Logs, discusses configuring an ECS container for logging. We demonstrated CloudWatch Logs using an ECS service for MySQL database. The only supported log driver for the Fargate launch type is the awslogs driver.
Chapter 4, Using Auto Scaling, introduces ECS service auto scaling as used with the Fargate launch type. Configuring auto scaling involves setting a range (minimum and maximum) for a number of tasks, within which auto scaling is applied.
Chapter 5, Using IAM, discusses configuring an IAM user for ECS. The root user does not require any permissions configuration and has access to the ECS resources, ECS Console, ECS API, and all the required AWS services. If an IAM user is to be used with ECS, the required IAM policies must be added to the IAM user.
Chapter 6, Using an Application Load Balancer, discusses configuring an ECS service with the Fargate launch type with an application load balancer to balance the HTTP requests for a Hello World service.
Chapter 7, Using Amazon ECS CLI , discusses using the ECS CLI to create a cluster of the Fargate launch type. Then, we will deploy a Docker Compose file on the cluster to run a task for a WordPress Docker image.
You should have prior knowledge of Docker, as the Fargate platform is a launch mode for Amazon ECS, a managed service for Docker containers. You should also have some prior knowledge of AWS and ECS.
If you do not already have one, you will need to create an AWS account at https://aws.amazon.com/resources/create-account/.
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
- Log in or register at www.packtpub.com.
- Select the
SUPPORT
tab. - Click on
Code Downloads & Errata
. - Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR/7-Zip for Windows
- Zipeg/iZip/UnRarX for Mac
- 7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Amazon-Fargate-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/AmazonFargateQuickStartGuide_ColorImages.pdf.
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Verify that the version is 3.0 with the get-host
command."
A block of code is set as follows:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "ecs-tasks.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }
Any command-line input or output is written as follows:
Set-ExecutionPolicy RemoteSigned
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The Edit container
dialog gets displayed."
Feedback from our readers is always welcome.
General feedback: Email [email protected]
and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected]
.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected]
with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.