AWS Fargate DevOps: Autoscaling with Terraform at practice

A

Udemy Coupon: AUTOSCALINGFARGATE – active 05.09.2024-06.10.2024;
in case coupons are already expired, please check that page regularly – new one will appear soon


Web application traffic is mostly not stable. Promotions, advertising campaigns, night/day hours – all that cause fluctuations at loading. Managing these unpredictable fluctuations can be a challenge. The deviation between the lowest and highest traffic loads in a 24-hour period can be massive, making CPU and memory requirements as unpredictable as the weather.

From a DevOps perspective, you might wonder: how can we handle such dynamic behavior efficiently?

Consider this scenario: during peak traffic, you need 4 CPUs and 4GB of memory. If you allocate these resources to all hours per day, you’re wasting resources during peak hours.

On the other hand, if you try to adjust CPU and memory to the average load – the application might lag or even crash during peak times.

So, a reasonable question appears – how to keep your customers satisfied while using resources wisely? The answer lies in autoscaling – adjusting your computing power based on real-time demand.

Autoscaling might seem like a daunting DevOps skill to master, but with AWS Fargate, you can get the balance between efficiency and simplicity. I’ve prepared on-line course that 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.

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; the code we’ll use is extremely simple, so much so that even a child could understand it with ease.

In the 2d section we will create a base AWS infrastructruce – all stuff related to the network, and additional services required for our lab environment – ALB, SNS, SQS, CW, different IAM policies and roles. 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.

This will also serve as the culmination of our lab environment setup.

The fourth 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 we will even create an autoscaling policy based on a custom CloudWatch metric for scaling workers.

Together, we’ll conduct CPU and memory stress tests on our service, prompting AWS Fargate to scale up the number of deployed containers for our API, and then scale them back down as traffic decreases. This hands-on experience will give you a full understanding of autoscaling in action. All autoscaling scenarios would be realized with terraform modules. 

In the final, fifth 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. This section will equip you with the knowledge to manage costs effectively while leveraging AWS Fargate to its fullest potential.

That’s all. See you at the 1st section, where we will start to examine test api application. Hope to see you soon.


About the author

sergii-demianchuk

Software engineer with over 18 year’s experience. Everyday stack: PHP, Python, Java, Javascript, Symfony, Flask, Spring, Vue, Docker, AWS Cloud, Machine Learning, Ansible, Terraform, Jenkins, MariaDB, MySQL, Mongo, Redis, ElasticSeach

architecture AWS cluster cyber-security devops devops-basics docker elasticsearch flask geo high availability java machine learning opensearch php programming languages python recommendation systems search systems spring boot symfony