ntier – aws
- For manual creation steps, refer classroom video
- Steps:
- import key pair (generate key pair)
- Figure out ami id for os
ami-0f8e81a3da6e2510a - instance type
t2.micro - select security group
Realizing in terraform
- we need to import key pair Refer Here for resource
- Refer Here for the changes to import the key
- Refer Here for the changes in the template to accomodate the ec2 instance creation
- AMI id as user input is an horrible idea, we need to fix that and multiple inputs for one ec2 instance can be combined into one variable (object/map)
- Exercise:
- Try creating an ec2 instance in web subnet also with similar configuration
Terraform – Concepts
- To read the contents of the file we have file function Refer Here
- Creating a key pair in terraform Refer Here
- Refer Here for the sample using the creation
- Taint and untaint in terraform: Refer Here
