PROVISIONING VPC, SECURITY GROUP AND EC2 INSTANCE USING TERRAFORM AUTOMATION SCRIPT☁️👩‍💻 !!

What is terraform 🤷‍♀️??

How terraform works ?

Terraform Init :

Terraform plan :

Terraform Apply :

Terraform Refresh :

Terraform Destroy :

  1. Create connection between aws and terraform using “terraform provider” service.
  2. Create Virtual Private Cloud.
  3. Create internet gateway , subnets and routing table inside that VPC.
  4. Create security group with inbound and outbound traffic rules.
  5. Lastly launch EC2 instance using newly created vpc, subnets and security group.

📑 Directory Structure:

Step 1:

Step 2:

Create VPC—

Now create two Subnets — one is Public and one is Private.

Step 3:

Internet Gateway -

Step 4:

Launching Security Group —

Step 5:

Create EC2 Instance —

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store