Skip to content

Commit

Permalink
Add ADR 0009
Browse files Browse the repository at this point in the history
  • Loading branch information
deer-wmde authored and tarrow committed Sep 4, 2023
1 parent 46cfa3c commit 4bb854c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/adr/0009-terraform-style-conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 9) Terraform style conventions {#adr_0009}

Date: 2023-05-16

## Status

proposed

## Context

When adopting Terraform as part of our infrastructure as code setup in the past, we did not settle on any code style format conventions. Since there is a built-in command to Terraform to streamline source files according to the officially recommended [style conventions](https://developer.hashicorp.com/terraform/language/syntax/style), we could make use of this to make our configuration more readable, especially for code review in pull requests.

## Decision

We use `terraform fmt` with it's defaults to auto-format files containing the Terraform Configuration Language. For now this has to be done manually - git hooks to run it automatically and/or a CI test to check for it are welcome.

## Consequences

To streamline all of the existing configuration we create a PR which formats all of the code. As mentioned above, right now it's up to the engineers to run this step on their machines before checking in Terraform code.

1 change: 1 addition & 0 deletions doc/adr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Current ADRs include:
- [6) Production as the configuration base case for helmfile values](0006-helmfile-base-values.md)
- [7) Application level monitoring using Prometheus](0007-monitoring-prometheus.md)
- [8) Deploying a service mesh to the Kubernetes Cluster](0008-service-mesh.md)
- [9) Terraform style conventions](0009-terraform-style-conventions.md)
<!-- toc-end -->

---
Expand Down

0 comments on commit 4bb854c

Please sign in to comment.