Terraform contd
Terraform console
- Refer Here for using terraform console
- To launch terrform console, execute
terraform consolecommand in directory with .tf files
Implicit depenedency
- Refer Here for the changes
- A resource will be dependent on other resource implicitly if the attributes of the other resource are used as arguments.
AWS: Create a VPC with 4 subnets
-
Overview
- Manual steps
Style Guide & Linting in terraform
- Lets follow google style guide for terraform Refer Here
terraform fmtor format document in vscode- updated workflow
- init
- fmt
- validate
- apply
- destroy
- We would be creating the following files in terraform template
- providers.tf: This file will have all the necessary stuff for configuring providers
- main.tf: This is where we start with declaring resources
- Tags for aws
- Refer Here for the changes done
Exercise:
- Create a network (Virtual network) in central india with 4 subnets
- note: in azure there is no need to provide zone while creating subnet
