feat: use newest Hub modules for STACKIT - #9
Conversation
18c07de to
fd45434
Compare
|
Taking this over. Rebased on The bump could not land as written
The rename shipped without moved blocksThree resources change address between
meshcloud/meshstack-hub#256 adds the moved blocks. This PR now pins Plan against live statePlanned with a clean terragrunt cache and no provider dev override. The lock file needs no change. Note that the building block instance also carries the Not applied — the apply and the building block run still need watching, because the moved blocks only take effect inside that run. |
|
Checked the role mapping from 41a82cc with
|
| Role | Permissions | Has resource-manager.project.delete |
|---|---|---|
reader |
349 | no |
editor |
809 | yes |
owner |
842 | yes |
What the cap does buy
owner holds 33 permissions editor does not. The ones that matter here are iam.member.add, iam.member.remove, iam.role.add, iam.role.edit, iam.role.remove and the per-product role-binding permissions (vpc.role-binding.*, secrets-manager.*.role-binding.*, data-catalog.instance.policy.administer).
Without them a tenant cannot grant STACKIT access to people meshStack does not know about. That matters because stackit_authorization_project_role_assignment in the project building block is a for_each over meshStack's own project members only, so an assignment made by hand is invisible to it and survives every later run.
The remainder of the 33 are incidental: argus.grafana.*administrate, mailout.sending-domain.*, postgres-flex.instance.force-delete, mongodb-flex.project.delete, telemetry-link.instance.*, support.assume-role.*, model-experiments.instance.login, sqlserver-flex.instance.protect.
Two things to be aware of
role_mapping is a STATIC input on the STACKIT Project definition, in both the old and the new hub ref. It is not a default tenants can override, so every existing tenant picks the new value up on its next run: each admin's alice@example.com:owner assignment is destroyed and alice@example.com:editor created. No project or resource is touched, but current trial admins are demoted.
After the change admin and user both map to editor, so the two meshStack roles are indistinguishable inside STACKIT.
If protecting the project from deletion is actually wanted, this mapping is not the lever. resource-manager.lock.* is in editor too, so a tenant could remove a lock as easily as set one. It would need a custom STACKIT role.
Plan is unchanged: 0 to add, 2 to change, 0 to destroy.
setup-env.sh opens a port-forward and a Vault login on every shell, which is slow when you run several units in a row. Caching its output in a gitignored .env and sourcing that instead is much faster, so keep the file out of the repo.
583ad14 to
b0bc69c
Compare
…cord the gap it leaves 41a82cc capped meshStack admins at the STACKIT `editor` role and said `owner` had to go because it permits deleting the project out from under meshStack. `stackit project role list` says otherwise: `editor` carries resource-manager.project.delete just as `owner` does, so the cap never protected the project. Only `reader` lacks the permission, and a sandbox user cannot work with `reader`. What the cap does buy is worth keeping. Of the 33 permissions `owner` holds and `editor` does not, the ones that matter here are iam.member.add, iam.member.remove, iam.role.add, iam.role.edit, iam.role.remove and the per-product role-binding permissions. Without them a tenant cannot grant STACKIT access to people meshStack does not know about, which matters because the project building block writes role assignments only for meshStack's own project members, so anything granted by hand would stay invisible to it and survive every later run. The deletion gap is now written down rather than assumed closed. A tenant that deletes its project leaves the STACKIT Project building block managing a project that is gone: the block's state still names it, and its next run fails or recreates it. Closing that needs a custom role, because STACKIT cannot subtract a permission from a built-in one and no data source reads a built-in role's permissions, so the custom role would have to carry `editor`'s other 808 names and be refreshed whenever STACKIT ships a service. Skipped: the list would rot silently and cost trial users access to new services, while the damage a tenant can do reaches no further than its own sandbox. Counts are from `stackit project role list` against the trial-metering project: reader 349 permissions, editor 809, owner 842. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This should fix custom metering not working moving forward: the hub adds the metering object to the STACKIT platform, without which meshStack generates no TURPs from pushed resource usage reports. The hub merged reference-architectures/stackit-sandbox-landingzone and stackit-hub-spoke into one stackit-landingzone that takes an optional `network`, so there is no directory at the old source path any more and `tofu init` fails on it. Leaving `network` unset keeps this deployment sandbox-only. That rename came without moved blocks, which would have destroyed and recreated three resources in the building block run: the backplane project holding the project-creation service account, the landing zone its tenants are assigned to, and the `STACKIT Project` definition every tenant project instantiates. None of them live in this repo's state, so meshcloud/meshstack-hub#256 adds the moved blocks and this pins f656771 rather than a93aba0, the tip of hub main. Re-pin once #256 merges. Planned against live state: 0 to add, 2 to change, 0 to destroy. Both changes are in place, the definition and the building block instance. The instance also carries the role_mapping change from 41a82cc, which was committed but never applied. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
b0bc69c to
e61d43e
Compare
41a82cc capped meshStack admins at the STACKIT `editor` role and PR #9 applied that cap. It works against what this landing zone is for. The sandbox is an open landing zone: real people should be able to use STACKIT freely, which includes granting access to others and escalating privileges through service accounts. `editor` withholds iam.member.add, iam.role.add and the per-product role-binding permissions, so it blocks exactly that. Applied to the trial foundation: 0 to add, 1 to change, 0 to destroy, the role_mapping input on the landing zone building block. The nested `STACKIT Project` definition takes role_mapping as a STATIC input, so tenant projects pick `owner` up on their next building block run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This should fix custom metering not working moving forward