Decide on Terraform Configuration Pattern for Application Repositories
Context and Problem Statement
The infrastructure monorepo that exists within an organization is responsible for configuring the core infrastructure of the organization: AWS accounts, VPCs, Kubernetes clusters, Route53, etc. However, AWS resources and/or other dependencies specific to a single application — such as a single S3 bucket — is not in the scope of the infrastructure monorepo, and should be managed externally, such that developers responsible for the application in question can manage its dependencies via infrastructure-as-code.
Considered Options
In-repo Terraform
A Terraform configuration can be placed within the application repository and automated using atmos
. This Terraform configuration requires the infra-state.mixin.tf
mixin in order to be able to read the state of components in the infrastructure monorepo, for example from the eks
component.
Implementation
This implementation is described in detail in the following guide: How to Manage Terraform Dependencies in Micro-service Repositories .