Wednesday, June 24, 2020

AWS Hands-On: Break a Monolith Application into Microservices (Module 2)

Module 2: Deploy the Monolith
After containerizing the monolith service application, we now deploy it in AWS. It will run in a cluster that will have 2 replicas with an Application Load Balancer in front for minimum high-availability. 

Key services that was used in this hands-on:Amazon Elastic Container Service, Amazon Elastic Container Registry, AWS CloudFormation, and Elastic Load Balancing. Most of the procedures were done in AWS console although the AWS CloudFormation part can also be done through the AWS CLI.

Step 1. Launch an ECS Cluster using AWS CloudFormation.
This is where we run the infrastructure code in the project that we cloned from Module 1.

The resulting infrastructure will have the following resources:
  • A VPC with 2 Public subnets (1 for each container), and Internet Gateway and Route Tables for public access
  • An ECS Cluster with a defined Security Group
  • An Application Load Balancer
  • An IAM Role for the ECS service
 Step 2. Verification steps to check that the cluster is running.

Step 3. Writing the Task Definition.
Task definitions specify how Amazon ECS deploys the application containers across the cluster. This is where referencing to the application image repository that was created in Module 1 happens.

Step 4. Configure the Application Load Balancer: Target Group
The Application Load Balancer will route network traffic to the container instances through a Target Group that refers to the VPC that was created in Step 1.

Step 5. Configure the Application Load Balancer: Listener
The ALB Listener checks for incoming connection requests to the ALB.

Step 6: Deploy the Monolith as a Service

Step 7: Test the Monolith

0 comments:

Post a Comment