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

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

Add an application load balancer to Amazon EC2 using Terraform

A highly available application has a higher chance of attracting customers because they are assured of consistency in service. Load balancing is a cost-effective way to increase an application's availability. In this note, I describe the steps to add an application load balancer to three Amazon EC2 instances hosted in three public subnets in different … Continue reading Add an application load balancer to Amazon EC2 using Terraform

Create a web-server on Amazon EC2 instance using Terraform and user data

In this note, I detail all the steps required to create a bare-bone web server on Amazon EC2. I discuss creating the Amazon Virtual Private Cloud, subnets, internet gateway, security group, and Amazon EC2 instances to finally automate the process via Terraform and user data. Note: I did not include the concepts of load balancing, … Continue reading Create a web-server on Amazon EC2 instance using Terraform and user data

Download Amazon S3 bucket into an Amazon EC2 instance in 5 steps using user data and Terraform

I required a few files and folders on an Amazon EC2 instance as part of the provisioning process. So, the objective was to upload these files and folders into an Amazon S3 bucket and download them from the Amazon EC2 instance with the assistance of the user data script and Terraform. Note: As a reader … Continue reading Download Amazon S3 bucket into an Amazon EC2 instance in 5 steps using user data and Terraform

Install AWS CLI on a Windows Amazon EC2 instance using Terraform and user data

In the last post, I discussed the steps involved in installing AWS.Tools module for PowerShell on Amazon EC2 using user data and Terraform. This post lists the steps to install the AWS CLI on an Windows Amazon EC2 instance. I used Amazon EC2 user data and Terraform to automate AWS CLI installation as part of … Continue reading Install AWS CLI on a Windows Amazon EC2 instance using Terraform and user data

Install AWS.Tools module for PowerShell on Amazon EC2 using user data and Terraform

I was under the impression that all Amazon EC2 instances have the latest version of AWS CLI installed. So, I was in for a shock when I discovered that is not always the case. However, I was required to use the AWS CLI, and since this was an Amazon EC2 with Windows OS, I proceeded … Continue reading Install AWS.Tools module for PowerShell on Amazon EC2 using user data and Terraform