Consolidate infra config from tfvars files into config module
Last updated
Was this helpful?
Last updated
Was this helpful?
Status: accepted
Deciders: @lorenyu @rocketnova @kyeah @acouch
Date: 2023-09-07
Technical Story:
Currently, application infrastructure configuration is split across config modules (see ) as well as .tfvars files in each of the application's infra layers - infra/app/build-repository, infra/app/database, and infra/app/service. As @kyeah pointed out, itβs easy to make mistakes when configuration is spread across multiple files, and expressed a desire to manage manage tfvars across environments all in a single file the way that some applications do for application configuration. And as @acouch , there is a lot of duplicate code with the configure scripts (setup-current-account.sh, configure-app-build-repository.sh, configure-app-database.sh, configure-app-service.sh) that configure the backend config and variable files for each infrastructure layer, which increases the burden of maintaining the configuration scripts.
This ADR proposes the following:
Move all environment configuration into modules
Remove the need for .tfvars files
Remove the configuration scripts that are currently used for configuring each infrastructure layer
Benefits:
All configuration can now be managed in the module.
Custom configuration scripts now longer need to be maintained
Eliminates the need to specify -var-file option when running terraform apply, which reduces the need for terraform wrapper scripts
Builds on