Table of Contents:
Background
Below we’ve included established infrastructure-as-code best practices in the industry and that we follow and suggest at Master. As we assess each client’s environment as part of our audit, we work to check the status of each of these practices in the associate best practices checklist spreadsheet provided. This document serves as a reference to give more details on each practice and follow-up information if you’d like to learn more.
It’s important to note that not all practices are applicable to every organization. Refer to your Masterpoint Audit Report for the more comprehensive and detailed information that is tailored to your organization.
Our Pattern Library
One area we would suggest you also read through is the Masterpoint Pattern Library. This set of documentation covers quasi-blog posts that cover specific topic areas that we have opinions on or longer-form advice on. You can find the library here: https://docs.masterpoint.io/pattern-library
Practices
1. General Practices
1.1 Don’t Reinvent the Wheel
-
Use Established Frameworks and Tools – Example: Instead of building your own Terraform framework leverage existing tools like atmos or Terramate to avoid unnecessary complexity and effort.
-
Avoid Building Custom Solutions – Avoid building your own frameworks, pipelines, or child modules from scratch when suitable alternatives exist.
1.2 Utilize Open Source
- Embrace open-source solutions to speed up development, enhance security, and benefit from community support.
1.3 Use Community Modules Whenever Possible
- Use well-maintained community modules from actively maintained and well-documented sources.
- Example: Before creating a new module for AWS EKS cluster check if a community module from CloudPosse or Terraform AWS modules meets your requirements to standardize and simplify your infrastructure code.
1.4 Use Terraform Frameworks Judiciously
- We typically suggest using a Terraform framework like atmos or Terramate if you’re doing a lot of Terraform operations (plans, applies, imports) locally and/or writing your own pipelines for Terraform automation. These frameworks provide a strong foundation for you to build off of so that you don’t end up reinventing the wheel too much.
- Only opt for vanilla Terraform if you are fully committed to a Terraform Automation and Collaboration Software (TACOS) vendor like Spacelift.
- However, if you are fully committed to a specialized Terraform automation and orchestration vendor, then a lot of the code's organizational needs and practices can get clarified with a simpler setup. In this case, building your Terraform organization partially custom with Vanilla TF to suit your needs is more reasonable.
1.5 Don’t Deploy Product Applications Through Terraform