Skip to content

Improved dependency application in exported HCL#625

Merged
magodo merged 6 commits intoAzure:mainfrom
gerrytan:replace-id-with-tfaddr-on-transitive-dep
Jun 13, 2025
Merged

Improved dependency application in exported HCL#625
magodo merged 6 commits intoAzure:mainfrom
gerrytan:replace-id-with-tfaddr-on-transitive-dep

Conversation

@gerrytan
Copy link
Copy Markdown
Member

@gerrytan gerrytan commented May 27, 2025

This PR improves dependency application in the exported HCL by refactoring the deduplication logic and respecting transitive dependency when selecting implicit / depends_on strategy.

Given the below dependency graph:

flowchart LR
  A --"rg_name"--> R["Res. group"]
  B --"a_id"--> A
  B --"rg_name"-->R
Loading

The exported HCL of A will have a depends_on to the resource group as per current behaviour, but B now only have implicit azurerm_a_resource.res-1.id TF address reference. The logic now understands that the transitive dependency to the Res. group is implied.

@gerrytan gerrytan force-pushed the replace-id-with-tfaddr-on-transitive-dep branch from ba69efd to c38ceca Compare June 6, 2025 07:14
gerrytan and others added 3 commits June 13, 2025 10:29
- Refactor config_info model, avoid redundant types
- Shorten variable names
- Avoid strong string types
@magodo magodo merged commit 72a2a69 into Azure:main Jun 13, 2025
7 checks passed
@magodo magodo added the enhancement New feature or request label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants