Skip to content

Fix Azure resources rendering without their icons - #210

Open
vasanth064 wants to merge 2 commits into
patrickchugh:mainfrom
vasanth064:fix/azurerm-static-web-app-and-frontdoor-aliases
Open

Fix Azure resources rendering without their icons#210
vasanth064 wants to merge 2 commits into
patrickchugh:mainfrom
vasanth064:fix/azurerm-static-web-app-and-frontdoor-aliases

Conversation

@vasanth064

@vasanth064 vasanth064 commented Aug 28, 2026

Copy link
Copy Markdown

Terravision ships icons for several Azure resources it can't reach, so they render as blank or unconnected nodes. Two causes.

1. Wrong icon directory hides 41 classes

resource_classes/azure/databases.py sets _icon_dir to resource_images/azure/database, but its icons ship under resource_images/azure/databases. 41 of its 45 classes point at a file that doesn't exist.

Nothing warns about it — the alias resolves, so the renderer believes it has an icon and draws an empty node.

It also spreads. modules/drawing.py flattens the package into one namespace, so the alphabetically last module wins: databases.py overrides database.py's azurerm_redis_cache and azurerm_postgresql_flexible_server, which were mapped to classes whose icons are correct. Both render blank in every Azure diagram.

Fix: one character, databasedatabases.

2. Two missing Terraform aliases

  • azurerm_static_site was renamed azurerm_static_web_app in the provider; only the old name is mapped, so static-apps.png is unreachable. The legacy alias is kept.
  • azurerm_cdn_frontdoor_* is not mapped at all, leaving FrontDoorAndCDNProfiles unreachable. Classic CDN isn't an alternative — creating azurerm_cdn_profile has been blocked since 1 Oct 2025, so no CDN resource in a current config draws an icon.

Fix: six alias lines. No new icons, no logic, no dependencies.

Effect

On a 29-resource Azure config (VNet, subnets, AKS, App Gateway, Load Balancer, PostgreSQL Flexible Server, Redis, Front Door, Static Web App), missing-icon warnings drop from 8 to 2. Static Web App and the five Front Door resources gain icons and edges; Redis and Postgres stop rendering blank.

Remaining 2 warnings are out of scope: azurerm_postgresql_flexible_server_database, azurerm_private_dns_zone_virtual_network_link.

Tests

  • tests/test_azure_icon_dirs.py — asserts every Azure class with an _icon points at a real file, catching the class of bug rather than this instance. Reverting the _icon_dir line: 41 failed.
  • tests/test_azure_web_aliases.py — covers the alias mappings. Reverting the alias block: 12 of 15 failed.
  • poetry run pytest tests -m "not slow"1719 passed, 5 deselected.
  • poetry run black --check on modules and all changed files — 39 unchanged.

Written with AI assistance (Claude), per CONTRIBUTING. I reviewed the diff; all counts above are from local runs.

…icons

Both icons already ship with Terravision but neither is reachable, so the
resources render as generic unconnected nodes.

- azurerm_static_site was renamed azurerm_static_web_app in the AzureRM
  provider. Only the old name was aliased, so current configurations miss
  static-apps.png. The legacy alias is kept for older configurations.
- azurerm_cdn_frontdoor_* was never aliased, leaving FrontDoorAndCDNProfiles
  and front-door-and-cdn-profiles.png unreachable. Classic CDN is not an
  alternative for new work: creating azurerm_cdn_profile resources has been
  blocked since 1 October 2025, so Front Door is the only CDN path a current
  configuration can take.
- Adds tests/test_azure_web_aliases.py, which fails without this change.

No new icons or logic, aliases only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
_icon_dir read resource_images/azure/database while every icon the module
names ships under resource_images/azure/databases. 41 of its 45 classes
resolved to a file that does not exist.

Nothing reported this. The alias resolved, so the renderer believed it had
an icon and drew an empty node instead of warning.

modules.drawing loads every module in the package into a single namespace,
so the alphabetically last module wins. databases.py therefore overrode the
working aliases in database.py, which is why azurerm_redis_cache and
azurerm_postgresql_flexible_server rendered blank even though database.py
mapped both to classes whose icons are present.

Adds tests/test_azure_icon_dirs.py, which asserts every Azure class with an
_icon points at a file that exists. It fails on exactly those 41 classes
without this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vasanth064 vasanth064 changed the title Alias azurerm_static_web_app and azurerm_cdn_frontdoor_* to existing icons Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant