- Jenkins is up and running
- Terraform is installed in Jenkins
- Terraform files already created in your SCM
- Make sure you have necessary IAM role created with right policy and attached to Jenkins EC2 instance. see below for the steps to create IAM role.

Engineering DevOps & Cloud Excellence Through Real-World Enterprise Mentorship. 📧 Contact Coach AK: devops.coaching@gmail.com 📱 Call / WhatsApp: +1 (469) 733-5248

It is also a good practice to use SSH keys in Jenkins jobs instead of using user name and password.
Pre-requisites:
Create SSH keys in your Jenkins EC2 instance
Let's say that you have created EC2 instances manually even before you started using Terraform. If you like to import your EC2 instance into Terraform management you can use import command.
The terraform import command is used to import your existing resources(that were created outside Terraform) into terraform state. The command currently can only import one resource at a time. This means you can't yet point Terraform import to an entire collection of resources such as an AWS VPC and import all of it.
Watch the steps in YouTube Video:
To import a resource, create a tf file first write a resource block for it in your configuration, establishing the name by which it will be known to Terraform:
sudo vi myec2.tf
resource "aws_instance" "myinstance" {
# ...instance configuration...leave this as it is
}
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
Pre-requisites:
Before you can install or update the AWS CLI version 2 on Windows, be sure you have the following:
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
aws --version
aws-cli/2.2.9 Python/3.9.5 Darwin/20.4.0 source/arm64 prompt/off
Jenkins has powerful feature of master slave architecture which enables distributed builds. This article we will learn how to establish slave nodes on Ubuntu machines and integrate with Jenkins Master.
How to Configure GitLab Runner with Docker Executor on Ubuntu 24.04 EC2 In this tutorial, we will configure a self-hosted GitLab R...