Skip to content

refactor(gcp): unify GCP modules removing Azure-leaked duplicates#294

Merged
gdrojas merged 4 commits intomainfrom
refactor/gcp-module-consolidation
Apr 21, 2026
Merged

refactor(gcp): unify GCP modules removing Azure-leaked duplicates#294
gdrojas merged 4 commits intomainfrom
refactor/gcp-module-consolidation

Conversation

@gdrojas
Copy link
Copy Markdown
Collaborator

@gdrojas gdrojas commented Apr 20, 2026

Summary

  • Remove 4 duplicate GCP modules with Azure-leaked naming (acr/, dns/, nat/, vnet/) — canonical names are artifact-registry/, cloud-dns/, cloud-nat/, vpc/
  • Add tags variable to artifact-registry for repository labels and Workload Identity binding support
  • Add optional zone_name derivation to cloud-dns (auto-derived from domain if not provided: dots replaced with hyphens) and labels support
  • Add zone_id output to cloud-dns
  • Add descriptions to cloud-nat and vpc outputs

@gdrojas gdrojas force-pushed the refactor/gcp-module-consolidation branch from dab5e35 to 31141d3 Compare April 20, 2026 17:20
gdrojas added 4 commits April 21, 2026 10:39
Port the labels/tags feature from the duplicate acr module. Before
consolidating the two modules, artifact-registry lacks the ability to
set labels on the google_artifact_registry_repository, which is a
first-class GCP feature and was supported only in acr. Adding it here
ensures no feature is lost when acr is removed.
…ne_id output

Port features from the duplicate dns module before consolidating:

- zone_name becomes optional (default null). When omitted, it is derived
  from domain_name by replacing dots with dashes. Explicit zone_name
  still wins when provided.
- Add tags variable and labels = var.tags on the google_dns_managed_zone
  resource, mirroring the first-class label support GCP offers for
  managed zones.
- Add zone_id output (the resource .id attribute) alongside zone_name
  and name_servers, so consumers can reference the zone without a second
  data lookup.
- Enrich existing output descriptions.
- Add test cases for the derivation and labels behaviors.
Outputs without descriptions surface as "n/a" in the terraform-docs
generated README tables, degrading the published contract for
consumers. The duplicate nat and vnet modules had these descriptions;
restoring them here before removing those duplicates.
Completes the rename declared in 3a619f8 (Jan 27, "feat(gcp): unify
variable names and rename modules for consistency") which added new
directories without removing the originals, leaving four duplicate
module pairs that coexisted for three months with divergent variable
shapes.

Keeping the GCP-native names (artifact-registry, cloud-dns, cloud-nat,
vpc) and removing the Azure-leaked copies (acr, dns, nat, vnet). The
surviving modules retain their tftest.hcl coverage and the more
flexible google provider version constraint (>= 5.0, < 7.0). Features
that were only present in the deleted modules have been ported to the
kept ones in the preceding commits of this branch:

- artifact-registry now supports labels via tags variable
- cloud-dns now supports optional zone_name derivation, labels and
  exposes zone_id output
- cloud-nat and vpc output descriptions restored

Deleted:
- infrastructure/gcp/acr/
- infrastructure/gcp/dns/
- infrastructure/gcp/nat/
- infrastructure/gcp/vnet/

Breaking change for any external consumer pinning to these paths.
@gdrojas gdrojas force-pushed the refactor/gcp-module-consolidation branch from 31141d3 to 47a7533 Compare April 21, 2026 13:39
@gdrojas gdrojas merged commit 393ca97 into main Apr 21, 2026
42 checks passed
@gdrojas gdrojas deleted the refactor/gcp-module-consolidation branch April 21, 2026 13:59
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