Trigger instance refresh of Amazon EC2 Auto Scaling group with a launch template update using Terraform

This note continues my discussion on the Amazon EC2 Auto Scaling group that I started in my previous post, so please read that before this one. In that post, I explain the fundamentals of creating an Amazon EC2 Auto Scaling Group using Terraform. An Amazon Auto Scaling group consists of Amazon EC2 instances with specific … Continue reading Trigger instance refresh of Amazon EC2 Auto Scaling group with a launch template update using Terraform

Create an Amazon EC2 Auto Scaling group with metric scaling policies using Terraform

This note continues to explore the auto-scaling concept I discussed in my note  -create an ASG and load balancer with Terraform, so please read that note before this one. After creating the Amazon EC2 Auto Scaling group, the application development team would require the scaling policies to manage the correct number of Amazon EC2 instances. … Continue reading Create an Amazon EC2 Auto Scaling group with metric scaling policies using Terraform

Create Amazon EC2 Auto Scaling group and load balancer using Terraform and GitHub Actions

When project teams host an application or service on an Amazon EC2 instance, they have specific questions about the underlying infrastructure. A few of them could be: (a) Can the project team be assured that if some or all existing EC2 instances were terminated or unresponsive, new Amazon EC2 instances (with the application hosted) would … Continue reading Create Amazon EC2 Auto Scaling group and load balancer using Terraform and GitHub Actions

Create an Amazon EC2 instance with Session Manager access using Terraform

Sometimes, connecting an EC2 instance after provisioning is necessary to verify whether the user-data script ran successfully, review if something is passing/failing, etc. As of August 2023, there are four ways of connecting to an Amazon EC2 instance running on Linux from the AWS console  -EC2 Instance Connect, Session Manager, SSH client, and EC2 serial … Continue reading Create an Amazon EC2 instance with Session Manager access using Terraform

Deploy Across AWS Accounts Like a Pro: Terragrunt, Terraform, and GitHub Actions

In the past, I've written a note explaining the process of deploying the Terraform IaC configuration into an AWS account using GitHub Actions. In this note, I extend that functionality and deploy the same Terraform IaC configuration across multiple AWS accounts using Terragrunt and GitHub Actions. Before we delve deeper, let me briefly explain the … Continue reading Deploy Across AWS Accounts Like a Pro: Terragrunt, Terraform, and GitHub Actions

Add an application load balancer to Amazon EC2 instances in a private subnet

In this note, I create a highly available environment using Amazon EC2 instances spread over multiple availability zones attached to an application load balancer. I also have a link to my GitHub repository with the code. In the past, I wrote a note on how to toggle traffic between three EC2 instances in three availability … Continue reading Add an application load balancer to Amazon EC2 instances in a private subnet

Implement pull request-based workflow using Terraform, Infracost, Checkov, and GitHub Actions

The software development process has continuously evolved over the past several years. The evolution process continued with the wide-scale availability of cloud platforms like AWS and Azure. We realized the practice of infrastructure as code (IAC) when the development practice of coding was merged with the operations practice of creating and managing cloud infrastructure. Then, … Continue reading Implement pull request-based workflow using Terraform, Infracost, Checkov, and GitHub Actions

Estimate AWS Cloud resource cost with Infracost, Terraform, and GitHub Actions

There are two broad aspects to running a successful business. These are (a) creating a product that generates revenue and (b) managing the product cost that is lower than the revenue. E.g., if the product generates $100 in revenue and costs $90, then the business can survive because it is generating a 10% profit margin. … Continue reading Estimate AWS Cloud resource cost with Infracost, Terraform, and GitHub Actions

Create AWS Secrets Manager secret using Terraform secure variables and GitHub Actions secrets

A little while back, I encountered an exciting use case requiring me to use GitHub Actions secrets. The use case was to create an AWS Secrets Manager secret resource using Terraform in a CI/CD pipeline. An AWS Secrets Manager secret is a resource to store secure credentials. In the past, I created an AWS Secrets … Continue reading Create AWS Secrets Manager secret using Terraform secure variables and GitHub Actions secrets