
Apply pre init terraform to create state and logs, then build a multi-subnet VPC with private and public networks, security groups, and an ALB; configure SNS for alerts.
Route DNS to Route 53, where an A record points to an application load balancer, which forwards requests to the AWS Fargate deployment via a target group.
Explore the Fargate Terraform module, including ECS cluster setup, capacity providers, and a task definition template. Compare VPC network mode implications and Linux runtime platform choices.
Explore a Fargate task definition template in a Terraform module, covering memory and CPU limits, port 5000, log group and stream, health checks, and environment with SSM secrets.
Explore testing predefined CPU and memory autoscaling in AWS Fargate by running stress-ng inside an ECS container, monitoring with CloudWatch alarms, and observing task count changes and scaling history.
Master autoscaling with CPU and memory targets, stress testing, and CloudWatch alarms, plus step autoscaling and backlog per instance metrics for SQS, while noting AWS Fargate cost considerations.
Compare AWS Fargate costs to EC2 using the pricing calculator in Frankfurt, focusing on CPU and memory pricing; the example shows Fargate about 2.3x more expensive than EC2.
What you'll learn:
How to deploy Web API application and SQS worker at AWS Cloud using AWS Fargate and Terraform
AWS ECS base components and how to deploy them using Terrafom
What is autoscaling and how it works at AWS Fargate
How to create autoscaling policies using target metric values + Terraform
How to create autoscaling policies using predefined step increments + CloudWatch alarms + Terrafom
How to create autoscaling policy based on a custom CloudWatch metric for scaling workers
How to use AWS Fargate wisely - CPU architectures, savings plans, and hybrid Fargate Spot systems as strategies for for cost reduction
Requirements:
Active AWS account
Some active web domain
Basic knowledge at using docker and web programming
Basic knowledge at Terraform
AWS basic conceptions, e.g VPC, EC2, subnets, security groups...
AWS ECS basics.
Short description:
This course is designed to guide you through the practical implementation of autoscaling using Terraform and AWS Fargate. It discovers how to optimize resource use effectively and ensure seamless application performance, all while managing costs wisely. ATTENTION - it is not the course where I will be writing code from zero, as it will take 6 hours to do it - it is the course where you will get ready code and solutions + clear explanations how to use it.
COURSE STRUCTURE:
The course consists of 5 sections:
In the 1st section we will create a test web application and test worker, forming the lab environment for hands-on auto scaling practice. No prior knowledge of those technologies are required.
In the 2d section we will create a base AWS infrastructure - all stuff related to the network, and additional services required for our lab environment - ALB, SNS, SQS, CW. Finally we will configure the real domain for our application using Route 53 and CM. Almost all that would be done rather fast, as we will be using ready terrafom modules.
The 3d section focuses on AWS Fargate. Here, we'll explore the core components of AWS Fargate and deploy our test API application, working towards achieving our desired final architecture.
The 4th section is the heart of our course, where we'll dive deep into autoscaling. We'll explore various autoscaling strategies, including target metric values and predefined step increments using CloudWatch alarms. You'll learn to work with CPU and memory utilization metrics and even create an autoscaling policy based on a custom CloudWatch metric for scaling workers.
In the final, 5th section, we'll discuss the costs involved with AWS Fargate, compare it with EC2 pricing and discuss how to navigate via Fargate limitations. You'll learn strategies to use this technology wisely, ensuring your expenses stay low while maximizing its benefits. We'll cover topics such as CPU architectures, savings plans, and hybrid Fargate Spot systems.
Who this course is for:
Anyone who is interested at autoscaling or who is responsible for Web resources:
Software engineer
DevOps
Admin
CTO
CEO