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

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

Automate Terraform configuration scan with Checkov and GitHub Actions

Terraform enables developers to create cloud resources via a few lines of code. Hence, these developers must write code that is easy to understand and follows security best practices. Moreover, following best practices becomes a habit if there is a system to keep that in check. Checkov is a proven static analysis tool that checks for standard best practices in your … Continue reading Automate Terraform configuration scan with Checkov and GitHub Actions

CI-CD with Terraform and GitHub Actions to deploy to AWS

GitHub Actions is a CI/CD tool that can automate the provisioning of AWS resources using Terraform. Previously, I wrote a detailed post explaining the concepts associated with using Terraform to create an application load balancer that you can read here -add an application load balancer to Amazon EC2 using Terraform. In this note, I further … Continue reading CI-CD with Terraform and GitHub Actions to deploy to AWS

Securely integrate AWS Credentials with GitHub Actions using OpenID Connect

Recently, I had a request come up where I had to interact with AWS resources from GitHub Actions. In the past, I had done this using Azure Pipelines. I did that by: (a) storing the credentials (access_key and secret_key of the IAM user) as secure variables in the Azure DevOps Library variable group and (b) … Continue reading Securely integrate AWS Credentials with GitHub Actions using OpenID Connect

A detailed guide to securely integrating Amazon Managed Grafana with Terraform

Over the last couple of months, I worked extensively on Amazon Managed Grafana to create dashboards for observability. In the course of automating the deployment using Terraform and a CI-CD system, I learned about a few challenges and identified solutions. I'm sharing my learnings in this note so that you do not make the same … Continue reading A detailed guide to securely integrating Amazon Managed Grafana with Terraform