Skip to content

Azure: assert IaC parity between customer ARM/TF and host TF for CUDly RBAC #753

Closed

Description

@cristim

Summary

The CUDly Azure custom role action list lives in three places:

  1. terraform/modules/iam/azure/cudly-reservation-role/main.tf (shared Terraform module, added in PR fix(iac/azure): custom role grants Microsoft.Capacity/reservationOrders/purchase/action #744)
  2. arm/CUDly-CrossSubscription/template.json (customer ARM onboarding template)

Even with the shared Terraform module introduced by PR #744, the ARM JSON file still duplicates the actions list and must be updated manually whenever actions are added or removed. There is currently no CI guard that fails when one source changes without the other.

Impact

Drift between the Terraform module and the ARM template would cause different permission sets for customers who onboard via ARM (the documented path) versus those who onboard via Terraform. This is a latent correctness issue, not a security issue.

Proposed Fix Options

Pick one:

a. tflint custom rule or unit test that diffs arm/CUDly-CrossSubscription/template.json's actions list against terraform/modules/iam/azure/cudly-reservation-role/main.tf.

b. Generate the ARM template from the Terraform source via a script that runs in CI (HCL -> ARM JSON), making the Terraform module the single source of truth.

c. CI path guard: fail the build when either file changes without the other (e.g. a paths-filter job in GitHub Actions).

Notes

Not urgent - drift only matters when actions are added to or removed from the role definition. The current action list is correct in both files as of PR #744.

Activity

  1. added 3 commits that reference this issue on May 27, 2026
    a152287
    48c4094
    29805ac
  2. cristim commented on May 28, 2026

    @cristim
    MemberAuthor

    Verified shipped: PR #761 (commit 29805ac, merged 2026-05-27) is in feat/multicloud-web-frontend. CI workflow gain a check-azure-role-parity.sh step that diffs arm/CUDly-CrossSubscription/template.json against the Terraform module; test script and fixtures added under scripts/testdata/role-parity/.

  3. added a commit that references this issue on Sep 27, 2026
    660697d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions