hands-on lab

Use AWS Fargate for Serverless Deployment of Container Applications

Difficulty: Intermediate
Duration: Up to 2 hours
Students: 1,736
Rating: 4.3/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

AWS Fargate is a compute engine for Amazon ECS. It allows you to create and deploy containers with no need to think about the servers or clusters. In the Lab, you will use Amazon Elastic Container Registry (ECR) to create a fully-managed Docker repository for your images. Amazon ECR is integrated with Amazon ECS, streamlining your development and deployment operations. You can use Amazon's other services such as Simple Storage Service (S3) and Identity and Access Management (IAM) to control and manage your entire container-based solution. In this Lab, you will build a Docker container image with Amazon CodeBuild, push the image to ECR, and perform a deployment operation using ECS with Fargate.

Lab Objectives

Upon completion of this Lab you will be able to:

  • Use application source files to create Docker container images and place them in Amazon ECR
  • Create an Amazon ECS cluster
  • Use the Amazon ECR images to create ECS task definitions and services
  • Implement the services in ECS by using AWS Fargate enjoying the advantages of serverless
  • Register ECS tasks with an Application Load Balancer (ALB) target group

Lab Prerequisites

You should be familiar with:

  • Basic understanding of AWS concepts including VPCs, S3 storage, and Load Balancing
  • An understanding of Docker and container concepts is helpful, but not required.

Updates

April 17th, 2024 - Resolved ECS Cluster creation issue

February 28th, 2024 - Updated the instructions and screenshots to reflect the latest UI

September 28th, 2023 - Updated the instructions and screenshots to reflect the latest UI

February 17th, 2023 - Updated lab to use aws/codebuild/standard:6.0 image

November 22nd, 2022 - Updated the instructions and screenshots to reflect the latest UI

March 14th, 2022 - Updated docker image

October 6th, 2021 - Corrected typing error

September 7th, 2021 - Updated to reflect the latest console experience

July 30th, 2021 - Updated CodeBuild instructions and screenshots, clarified other instructions to reflect latest UI changes

April 16th, 2021 - Moved validation checks to the most relevant lab step for more immediate validation feedback

May 24th, 2019 - Updated CodeBuild instructions and buildspec.yaml to work with the new standard Ubuntu image

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Creating an Elastic Container Repository
Building the Docker Image
Creating an AWS Fargate Cluster
Creating an Application Load Balancer
Creating a Fargate oriented Task Definition
Deploying the Fargate oriented ECS service
Testing the Deployment and Monitoring it