ShreyGupta
3 min readJun 14, 2020

POWER OF TERRAFORM IN AUTOMATION WORLD

What is Terraform ?

Terraform users define infrastructure in a simple, human-readable configuration language called HCL (HashiCorp Configuration Language). Users can write unique HCL configuration files or borrow existing templates from the public module registry.

Manage Configuration Files in VCS

Most users will store their configuration files in a version control system (VCS) repository and connect that repository to a Terraform Cloud workspace. With that connection in place, users can borrow best practices from software engineering to version and iterate on infrastructure as code, using VCS and Terraform Cloud as a delivery pipeline for infrastructure.

Automate Provisioning

When you push changes to a connected VCS repository, Terraform Cloud will automatically trigger a plan in any workspace connected to that repository. This plan can be reviewed for safety and accuracy in the Terraform UI, then it can be applied to provision the specified infrastructure.

IN THIS I USE HCL LANGUAGE & FOR REFRENCE IN TASK-https://www.terraform.io/

I worked on module of building aws ec2 instance , creating ebs volume, creating S3 bucket ,creating cloudfront with the tool terraform.

1. Create the key and security group which allow the port 80.

terraform init

terraform validate

terraform apply -auto-approve

2. Launch EC2 instance.

terraform init

terraform validate

terraform apply -auto-approve

3.Launch one Volume (EBS) and mount that volume into /var/www/html

Developer have uploded the code into github repo also the repo has some images. Copy the github repo code into /var/www/html

terraform init

terraform validate

terraform apply -auto-approve

4.Create S3 bucket, and copy/deploy the images from github repo into the s3 bucket and change the permission to public readable.

terraform init

terraform validate

terraform apply -auto-approve

5.Create a Cloudfront using s3 bucket(which contains images) and use the Cloudfront URL to update in code in /var/www/html

terraform init

terraform validate

terraform apply -auto-approve

FOR WEBPAGE LAUNCHING

terraform init

terraform validate

terraform apply -auto-approve

No responses yet