Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Latest commit

 

History

History
43 lines (27 loc) · 2.1 KB

2021-05-terraform-centralized.md

File metadata and controls

43 lines (27 loc) · 2.1 KB

Use Terraform in a Single Directory

Context & Problem Statement

Terraform for a project generally lives in a terraform/ directory. However, our repository includes multiple components as standalone services. Should infrastructure ownership be standalone, or should each service own it's own dependencies?

Priorities & Constraints

  • Delivery across the project has a single lead
  • Dependencies are more easily managed with a centralized terraform definition

Considered Options

  1. Terraform at /terraform: Terraform is contained in a single directory
  2. Terraform per Component: Each component (website, content-api, and delivery) has independent terraform definition & state
  3. Terraform Controller & Modules per Component: Terraform has centralized resources at /terraform and each component supplies it's own module. Each component may optionally provide it's own terraform entrypoint to be independently tested.

Decision

Chosen option: "[option 1] Terraform at /terraform".

With a single engineer overseeing responsible for terraform excellence and knowledge unevenly spread across the team, we want to avoid "premature optimization" of the components.

Expected Consequences

  • We have an "infrastructure monolith"
  • The infrastructure monolith further risks us falling into the "distributed monolith" anti-pattern for the application
  • As an example terraform implementation, we will be less effective at showing how service teams can own their own infrastructure

Research

Links

  • User Journey: #25