JohannesEH / infrastructure-modules

Terraform modules for infrastructure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

infrastructure-modules

Terraform modules for infrastructure

Containers to run this: https://hub.docker.com/u/dfdsdk

Terraform Best Practices

Terraform Files

  • main.tf
  • outputs.tf
  • vars.tf

Terraform Module Folder Structure

We recommend a folder structure for Terraform modules like so:

module-category
 └ module-name
    └ README.md
    └ main.tf
    └ outputs.tf
    └ vars.tf

Example:

security
 └ iam-account-alias
    └ README.md
    └ main.tf
    └ outputs.tf
    └ vars.tf
 └ org-account
    └ README.md
    └ main.tf
    └ outputs.tf
    └ vars.tf
network
 └ ...

Credits

The general structure of these modules, file layout etc. are largely based on Gruntwork's recommendations. More specifically the blog posts:

Gruntwork's example repos, of both modules and live/input data, along with their README files have also proven very useful:

To workaround some of Terraform's quirks and shortcomings:

Other inspiration:

About

Terraform modules for infrastructure

License:MIT License


Languages

Language:HCL 91.3%Language:Shell 4.3%Language:Go 3.0%Language:PowerShell 0.8%Language:Python 0.5%Language:Dockerfile 0.1%