canonical / solutions-engineering-automation

Repo for automating tasks for Solutions Engineering Team.
1 stars 5 forks source link

Manage hierachy of terraform variable #102

Open Pjack opened 1 month ago

Pjack commented 1 month ago

We need to declare the value of each Terraform variable for every project, which makes the PR lengthy when adding new variables. Here are some examples. https://github.com/canonical/solutions-engineering-automation/pull/39/files https://github.com/canonical/solutions-engineering-automation/pull/69/files https://github.com/canonical/solutions-engineering-automation/pull/101/files

We should manage Terraform variables with a hierarchy, allowing us to define default values for the template. Reference doc: https://medium.com/@mehmetodabashi/terraform-variable-usage-the-order-of-precedence-for-variable-sources-c91586ddb13f

We can also consider to adopt terragrunt so that we can many the default value for each group. Ex: https://github.com/canonical/charm-engineering-repos/blob/main/teams/observability/repos/common.hcl