Containerized Inventory Service

Purpose & Background

In this lab, you will:

  • Deploy the inventory service to Amazon Elastic Container Service (ECS) using the AWS Toolkit for Visual Studio.
  • Configure the Amazon API Gateway to route requests for inventory service to Amazon Elastic Container Service.
  • Enable auto-scaling for the inventory service and test using an open source load testing tool called Locust.

One benefit of microservices is that you can scale different services separately using different tools. In this lab, you will deploy the inventory service to Amazon Elastic Container Service (ECS). After the service is running in ECS, you will integrate it with API Gateway so that the inventory-related requests are redirected to our new microservice.

Inventory Service Architecture Diagram


  • Environment Setup
  • Facade Configuration

AWS Services Used in This Lab

Amazon Elastic Container Service (ECS) is a highly scalable and fast container management service that makes it easy to run, stop, and manage Docker containers in a cluster. It allows you to launch and stop container-based applications with simple API calls. You can also get the state of your cluster from a centralized service and access many familiar Amazon EC2 features. You can use Amazon ECS to schedule containers across your cluster based on your resource needs, isolation policies, and availability requirements. With Amazon ECS, you do not have to operate your cluster management and configuration management systems or worry about scaling your management infrastructure.

AWS Fargate is a serverless compute engine for containers that works with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS). Fargate makes it easy for you to focus on building your applications. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.

Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images. Amazon ECR is integrated with Amazon Elastic Container Service (ECS), simplifying your development to production workflow. Amazon ECR eliminates the need to operate your own container repositories or worry about scaling the underlying infrastructure. Amazon ECR hosts your images in a highly available and scalable architecture, allowing you to reliably deploy containers for your applications. Integration with AWS Identity and Access Management (IAM) provides resource-level control of each repository. With Amazon ECR, there are no upfront fees or commitments. You pay only for the amount of data you store in your repositories and data transferred to the Internet.

Amazon Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions. It can handle the varying load of your application traffic in a single Availability Zone or across multiple Availability Zones. Elastic Load Balancing offers three types of load balancers that all feature the high availability, automatic scaling, and robust security necessary to make your applications fault tolerant.