Terraform is a tool for building, changing and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solution.
We need to install the following packages if not installed already:
#yum install unzip -y
2.1: Let’s extract the downloaded zip terraform package:
2.2: Copy the extracted file to /usr/loacl/sbin and verify terraform installed version
3: Here we have installed terraform on linux box, let’s apin up first our Ec2 instance using terraform. First we need to setup the aws provider by creating the 3files- aws.tf, variable.tf and terraform.tfvars
aws.tf => This will configure the provider for aw, it uses string interpolation to pull variable from variable.tf file.
variable.tf => This file is typically full of environment specific configuration.
terraform.tfvars => This file will pass into each command and provides the secret and more specific values.
Run the “terraform init” command to initialize the provider plugins:
Once this check is passed, we are good to create our first terraform code to launch an Ec2 instance in aws:
Thank you for reading the article!
Hope you liked the post, we wish you best of luck, stay tuned and keep learning!