Skip to content

rguthriemsft/terraform-best-practices

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Best practices for terraform

Terraform Best Practices for Cloud users.

Table of Contents

the READM for terraform version 0.11 and less has been renamed to README.0.11.md

Run terraform command with var-file

$ cat config/dev.tfvars

name = "dev-stack"
tag_team_name = "hello-world"
 
$ terraform plan -var-file=config/dev.tfvars

With var-file, you can easily manage environment (dev/stag/uat/prod) variables.

With var-file, you avoid running terraform with long list of key-value pairs ( -var foo=bar )

Manage remote backend for tfstate files

Terraform doesn't support Interpolated variables in terraform backend config, normally you write a seperate script to define a backend storage name for different environments, but I recommend to hard code it.

Manage multiple Terraform modules and environments easily with Terragrunt

Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules. https://www.gruntwork.io

Visualize Tf resource configuration or execution plan using the Tf Graph

the Graph is great tool to visualize resource dependencies especially useful for complex Tf configurations - get started here

About

Terraform Best Practices for AWS users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 51.2%
  • Python 47.0%
  • Shell 1.8%