Skip to content

Terraform / OpenTofu

Snippets here work with both Terraform ≥ 1.3 and OpenTofu ≥ 1.6 unless noted otherwise.

Pages

  • Common variables


    Typed, validated variable blocks: environment, region, tags, CIDRs, instance type, FQDN, optionals, objects, secrets.

  • Module skeleton


    Opinionated layout for a reusable module.

  • Backends


    Remote state backends with locking and encryption.

  • Provider configuration


    Sensible defaults for AWS, GCP, Azure providers.

  • IAM policy patterns


    Least-privilege snippets you copy more than you'd like to admit.