DevOps Classroom notes 28/May/2025

Terraform contd

AWS: Create a VPC with 4 subnets revisited

  • Overview

Variables

variable <name> {
    type = 
}
  • Generally as per google’s style guide we create all the variables in variables.tf or inputs.tf
  • To use the variable the syntax is var.<name>
  • Refer Here for the variables added to aws vpc and 4 subnets
  • We can create a file <name>.tfvars where we can apply all the values and pass this file during terraform apply
  • Generally we will have <environment>.tfvars
  • Refer Here for changes done
  • Few variables to pass
terraform apply -var var1=value1 -var var2=value2 
  • many variables to pass, create a .tfvars file such as dev.tfvars
terraform apply -var-file="dev.tfvars"

Go through the template and lets discuss about any unknows in next 5 mins

loops

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%