Skip to content

Variables

Terraform variables let you parameterize modules and reuse infrastructure code.

Why They Matter

  • They reduce duplication.
  • They make modules reusable across environments.
  • They keep configuration values explicit.

Common Types

  • string
  • number
  • bool
  • list
  • map
  • object

Practical Notes

  • Define types whenever possible.
  • Use sensible defaults for safe local development.
  • Keep secrets out of plain variables when they should be protected.