DevOps Classroom notes 28/May/2025

Terraform contd

AWS: Create a VPC with 4 subnets revisited

  • Overview
    Preview

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 Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube