Thursday, August 31, 2023

TERRAFORM INSTALLATION ON WINDOWS 11

 


Terraform is an open-source infrastructure as code (IaC) tool that allows you to define and provision infrastructure resources across various cloud providers and on-premises environments. To install Terraform on Windows 11, you can follow these steps:

 

Terraform did not install on our system as we had expected in order to run the terraform program.

Observe the steps to install Terraform in your system. Download Link.

https://developer.hashicorp.com/terraform/downloads

Set path in an environment variable for the terraform.

Type terraform in CMD.

Run the Terraform command from the main.tf file’s storage folder.

Initialize the terraform.

terraform init

Run my first simple code.

provider "aws" {
   region     = "us-east-1"
   access_key = "AKIAYLT72WWP3MQN3Y6D"
   secret_key = "SlG5zvS9tujqan1sN2a2ospIC86b09WstQBSMkAZ"
}
resource "aws_instance" "ec2_example" {

   ami           = “ami-053b0d53c279acc90”
   instance_type = “t2.micro”

   tags = {
           Name = “Terraform EC2_001”
   }
}

terraform plan

To run the file and create the EC2 INSTANCE in AWS, use the apply command.

terraform apply

Process completes.

Now destroy the EC2 instance.

terraform destroy

End of Notes- TERRAFORM INSTALLATION

No comments:

Post a Comment