Ritik Raj
4 min readJun 17, 2020

Amazon Web Services (AWS) is a subsidiary of Amazon that provides on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis. In aggregate, these cloud computing web services provide a set of primitive abstract technical infrastructure and distributed computing building blocks and tools. One of these services is Amazon Elastic Compute Cloud (EC2), which allows users to have at their disposal a virtual cluster of computers, available all the time, through the Internet

Terraform is an open-source infrastructure as code software tool created by HashiCorp. It enables users to define and provision a data centre infrastructure using a high-level configuration language known as Hashicorp Configuration Language (HCL), or optionally JSON.

Configured AWS to log In through access key and secret key then put my region that is ap-south-1a and output format like JSON.

#provided a path in which I have to make a repository that is the local directory

#That made repository in which I have to work.

#Provided path of that repository that is local directory new

#Created a notepad file by the help of notepad task1.tf

In the notepad file codes were written to make

  1. Snapshots
  2. CloudFront creation
  3. Security group
  4. Instance
  5. Key pair
  6. Extra 1 gib volume
  7. S3 bucket

S3 bucket:-An Amazon S3 bucket is a public cloud storage resource available in Amazon Web Services’ (AWS) Simple Storage Service (S3), an object storage offering. Amazon S3 buckets, which are similar to file folders, store objects, which consist of data and its descriptive metadata.

Instance:-When you launch an instance, the instance type that you specify determines the hardware of the host computer used for your instance. Each instance type offers different compute, memory, and storage capabilities and are grouped in instance families based on these capabilities. Select an instance type based on the requirements of the application or software that you plan to run on your instance.

Key pair:-created a key pair to enable the terraform code to run this file.

Extra 1 GiB volume:- this extra volume works as a pen drive so that we can store data in it here I used to store one image that we will see as an output.

Security group:- that enabled port 22 for SSH and port 80 HTTP.

CloudFront creation:-Get started with the basic steps to deliver your content with CloudFront by creating a simple CloudFront distribution or by using the AWS for WordPress plugin. If you already have a WordPress website, we recommend using the AWS for WordPress plugin to create a CloudFront distribution. If you aren’t using WordPress, get started with simple CloudFront distribution.

Snapshots:-snapshot is used to get backup of the Ebs storage so that if we delete the instance we can save our files here I have created 1 Gib snapshot.

Null resource:-The null_resource implements the standard resource lifecycle but takes no further action.

I also used root user that is sudo yum command to install httpd in GitHub. Also used Sudo systemctl to restart and enable httpd. Used provisioner remote exec Sudo command to make a folder inside the Ebs, to mount the storage, and also to provide the git hub clone path.

In the output, we can see the availability zone with the region, public_ip address, and Ebs volume.

5. terraform init command to install plugin inside the new folder to run the code

6.terraform validate command is used to command validates the configuration files in a directory

7.terraform apply — auto-approve command is used to run the terraform code.

8. In Amazon, Web Server gives the following output as following.

GitHub link https://github.com/01892/pubg.git

Ritik Raj
Ritik Raj

No responses yet