Skip to content

visaltyagi/Terraform-Assignment-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform-Assignment-2

Terraform Assignment 2

For the detailed solution to this assignment, click this link: https://medium.com/devops-guides/create-an-ec2-instance-with-an-elastic-ip-address-terraform-assignment-2-85a5fcc5542b

Step 1: Destroy the previous assignment resources using the command: terraform destroy

Step 2: Assignment 1 Resources will be successfully deleted.

Step 3: Create a "main.tf" file, and paste the script code here.

Step 4: Initialize terraform using the command: terraform init

Step 5: Create a plan using the command: terraform plan

Step 6: Use this command to create an ec2 instance with an Elastic IP address: terraform apply

Step 7: The instance will be successfully created. Go to "EC2" Instance & an instance will be shown with an elastic ip address.