Terraform contd
ntier network in AWS
- Manual steps:
- Create a vpc
- network: 10.10.0.0/16 => 10.10.x.x ( 10.10.0.0 to 10.10.255.255)




- network: 10.10.0.0/16 => 10.10.x.x ( 10.10.0.0 to 10.10.255.255)
- Create a vpc
- Refer Here for the changes

-
After terraform apply we are observing three new files
- .teraform.lock.hcl
- terraform.tfstate
- terraform.tfstate.backup
-
Lets add one subnet
- cidr: 10.10.0.0/24 => 10.10.0.x => 10.10.0.0 to 10.10.0.255
- name: web 1



-
Refer Here for the changes
- Exercise: Try adding 5 more subnets
web2: 10.10.1.0/24
db1: 10.10.2.0/24
db2: 10.10.3.0/24
app1: 10.10.4.0/24
app2: 10.10.5.0/24
Concepts
- Refer Here for terraform locals
- Terraform works:
- Terraform when applied tries to figure out a plan to make the desired state an actual state (
terraform plan) - Terraform creates a file called as terraform.tfstate when it first creates some resource
- Terraform stores the information about the created resources in a json format called as
tfstate - terraform refresh updates the tfstate according to actual state

- Terraform when applied tries to figure out a plan to make the desired state an actual state (
