Skip to content

tgc-revival: Refactor FindIdentityParams to use multi-segment logical AND matching#5322

Merged
modular-magician merged 1 commit intoGoogleCloudPlatform:mainfrom
modular-magician:downstream-pr-4191ccc585829e0e8ca84c7155960fae2b225a09
Mar 20, 2026
Merged

tgc-revival: Refactor FindIdentityParams to use multi-segment logical AND matching#5322
modular-magician merged 1 commit intoGoogleCloudPlatform:mainfrom
modular-magician:downstream-pr-4191ccc585829e0e8ca84c7155960fae2b225a09

Conversation

@modular-magician
Copy link
Copy Markdown
Collaborator

Previously, the FindIdentityParams function within the TGC generator attempted to identify a single uniquely distinguishing URL path segment (IdentityParam) to differentiate between Terraform resources that share the exact same CAI asset type.

However, this naive approach fails on complex resource groupings like compute.googleapis.com/FirewallPolicy, where resources like NetworkFirewallPolicy and RegionNetworkFirewallPolicy share parameters globally and regionally, meaning they require a combination of path segments (e.g., "projects" AND "global") to be reliably identified.

This PR completely refactors the identity parsing logic to aggressively group all identifying segments together rather than isolating just one.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


Derived from GoogleCloudPlatform/magic-modules#16762

… AND matching (#16762)

[upstream:4191ccc585829e0e8ca84c7155960fae2b225a09]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit f119009 into GoogleCloudPlatform:main Mar 20, 2026
4 of 6 checks 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.

1 participant