Skip to content

docs: ADR 0001 — all generated cluster repo files must be versioned in terraform-eks-deployment #18

Merged
merged 2 commits into from
Apr 21, 2026

Conversation

arnol377
Copy link
Collaborator

ADR 0001

This PR adds an Architecture Decision Record documenting why all eks-*/terragrunt.hcl template files must be committed in terraform-eks-deployment/templates/eks-modules/ rather than pulled live from template-eks-cluster at plan time.

Key points

  • A single pinned commit of terraform-eks-deployment (REPO_BRANCH) must fully describe every file written into a generated cluster repo. Consistency cannot be guaranteed when files are split across two repos at independently-advancing refs.
  • The data.github_repository_file approach (PR Update Workflow for existing clusters #16) reads from template-eks-cluster:main at plan time, which can diverge from the _envcommon/ templates in this repo and silently produce internally inconsistent generated repos.
  • The GitHub repo template feature (template_repo) is not needed — CSVD/terraform-github-repo natively handles branch protection, CODEOWNERS, and team access.

Related to PR #16 (test_cluster).

…oyment

- Add all 20 eks-module terragrunt.hcl files to templates/eks-modules/;
  these are written verbatim (file()) into the generated repo under
  $env/$region/$vpc/$cluster/<module>/terragrunt.hcl
- Wire templates/eks-modules/ into managed_extra_files via a fileset-based
  local (eks_module_files) merged with the existing rendered_files local
- Set template_repo = null in both defaults.tf and main.tf; all generated
  repo content now flows exclusively through managed_extra_files with no
  GitHub template seeding
- Rename templates/common-variables.hcl and templates/default-versions.hcl
  to *.hcl.tf.tpl to match the existing convention: .tf.tpl = parsed by
  templatefile(), eks-modules/*.hcl = written verbatim
- Update locals.tf references for the renamed template files
- Fix alignment formatting in examples/basic and examples/adsd-tools-dev
Copy link
Collaborator

@morga471 morga471 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arnol377 arnol377 merged commit dcf8501 into main Apr 21, 2026
1 check failed
@arnol377 arnol377 deleted the docs/adr-0001-generated-file-source-of-truth branch April 21, 2026 18:00
arnol377 pushed a commit that referenced this pull request Apr 21, 2026
…es/eks-modules

Remove the data.github_repository_file / data.github_tree approach that read
cluster-level terragrunt files from the template-eks-cluster repo at runtime.
All HCL templates are now managed locally in templates/eks-modules/ inside this
module repo, consistent with the ADR merged in #18.

Changes:
- Remove effective_template_enabled_modules and template_cluster_sync_files locals
- Remove data.github_repository_file.template_cluster_files data source
- Remove template_repo_name, template_repo_ref, template_cluster_file_paths variables
- Move effective_template_enabled_modules into the eks_module_files locals block
  and apply enablement filter directly to the fileset loop
- Update desired_managed_files_by_path to use local.eks_module_files
- Update template_enabled_modules variable description to reflect local template usage
arnol377 pushed a commit that referenced this pull request Apr 21, 2026
* create new cluster to test

* update defaults to min/desired 2

* make csvd-dev-mcm cluster for testing

* add cluster for adsd-etdsb-tools-nonprod (#13)

* rename cluster in convo with customer (#14)

* Rename adsd tools (#15)

* rename cluster in convo with customer

* create cluster in csvd-common for testing

* update cluster workflow

* update environment_abbr based on account_name

* add .gitignore for new clusters

* update default-versions and common-variables gen

* rename to match

* fmt

* self ref doesn't work

* env fixed, add clusters folder

* update to track files in template-eks-cluster/

* fix(finops_codes) ensure passed in finops codes are used

* complete update workflow

* update version for otel-collector-k8s

* bump version of eks-dns and tempo

* complete update workflow, fix create workflow, open PRs on both

* remove cruft

* more tags

* update tags

* update tag handling and gen

* fix: replace local module path with CSVD GHE HTTPS source ref

* fix: point module source to CSVD/terraform-github-repo main (feat/files-branch-source-branch merged)

* refactor: replace template-eks-cluster remote sync with local templates/eks-modules

Remove the data.github_repository_file / data.github_tree approach that read
cluster-level terragrunt files from the template-eks-cluster repo at runtime.
All HCL templates are now managed locally in templates/eks-modules/ inside this
module repo, consistent with the ADR merged in #18.

Changes:
- Remove effective_template_enabled_modules and template_cluster_sync_files locals
- Remove data.github_repository_file.template_cluster_files data source
- Remove template_repo_name, template_repo_ref, template_cluster_file_paths variables
- Move effective_template_enabled_modules into the eks_module_files locals block
  and apply enablement filter directly to the fileset loop
- Update desired_managed_files_by_path to use local.eks_module_files
- Update template_enabled_modules variable description to reflect local template usage

---------

Co-authored-by: Dave Arnold <user@example.com>
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
2 participants