Terraform Best Practices — Using variables

Jack Roper
CodeX
Published in
6 min readApr 15, 2021

--

When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the sixth in the series which focuses on point 6 in the list, ‘Avoid hardcoding variables’, and also shows best practices for general variable use in Terraform.

  1. Use a consistent file structure across your projects.
  2. Use modules wherever possible.
  3. Use a consistent naming convention.
  4. Use a consistent format and style.

--

--

Jack Roper
CodeX
Writer for

A blog about DevOps & Cloud Tech. Specializing in Terraform, Kubernetes, Azure & Azure DevOps! ☁️