Skip to content

refactor: move environments from vendored module to root module#4

Merged
ljubon merged 7 commits intotest-gcss-1135from
refactor/env-root-module
Mar 19, 2026
Merged

refactor: move environments from vendored module to root module#4
ljubon merged 7 commits intotest-gcss-1135from
refactor/env-root-module

Conversation

@ljuboops257
Copy link
Copy Markdown
Collaborator

Summary

  • Removes github_repository_environment and github_repository_environment_deployment_policy resources from the vendored child module (modules/terraform-github-repository/) — vendored modules must not be modified
  • Re-implements environments at the root module level in main.tf, keyed by "repo:env" to avoid naming collisions across repos
  • Updates import blocks to target the new root-level resource addresses
  • Adds deployment policy import blocks for generated repos
  • Extracted deployment policy for_each logic into named locals (all_env_branch_policies_map, all_env_tag_policies_map) for maintainability

Closes reviewer comment: G-Research#28 (comment)

Test plan

  • terraform fmt produces no changes
  • terraform validate passes with "The configuration is valid."
  • Terraform plan shows no unexpected destroys for environment resources
  • All environment resource addresses use root-level github_repository_environment.environment["repo:env"], not module.repository[*].github_repository_environment

@ljubon ljubon merged commit eac377d into test-gcss-1135 Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants