IT3110 @ utahtech
Assignment
In this assignment, you will automagically create various AWS resources (Infrastructure as Code) using Terraform.
You will likely need to refer to the terraform AWS documentation to figure out how to do some of it. Here is the link.
Order doesn’t matter in the terraform file so the ordering of my steps below is irrelevant. I created everything in a single tf file.
YOU SHOULD APPROPRIATELY TAG EACH RESOURCE (YOU DECIDE HOW)
Tasks
tf-vpc
tf-subnet
tf-sg
tf-ig
and attach it to your vpc. (Hint: vpc_id = aws_vpc.tf-vpc.id )tf-r
and attach to your vpc.
0.0.0.0/0
tf-ig
aws_route_table_association
to associate your route table with your subnet. The documentation will help.aws_key_pair
named tf-key
. You will have to give it a public key. If you are doing this on the ssh machine, you should already have a public key in ~/.ssh/id_rsa.pub
, use that for the public_key argument for this resource. If you do not already have a public key on the machine you are running terraform from, you can generate one by doing ssh-keygen
.dev
, test
, and prod
. I used separate resource definitions for each.
tf-sg
with each instancekey_name
should be set to your previously created key tf-key
.terraform apply
successfully, you should be able to ssh to each of your virtual machines with something like ssh ubuntu@54.165.61.116
. You should also be able to visit port 80 of each machine in a browser to see if a webpage is showing.Submission
Pass off in class or via office hours. Or I guess you could record a video of things working and cat out your tfstate file.