Skip to content

fix(stackit): add the moved blocks the landing zone refactor missed - #256

Merged
grubmeshi merged 1 commit into
mainfrom
fix/stackit-landingzone-moved-blocks
Aug 14, 2026
Merged

fix(stackit): add the moved blocks the landing zone refactor missed#256
grubmeshi merged 1 commit into
mainfrom
fix/stackit-landingzone-moved-blocks

Conversation

@grubmeshi

Copy link
Copy Markdown
Collaborator

The unification of stackit-sandbox-landingzone and stackit-hub-spoke into stackit-landingzone (#0ef0fdd) renamed three resources but shipped no moved blocks. Any landing zone deployed against an older ref destroys and recreates them on its next building block run.

Found while taking over meshcloud/trial-cloudfoundation#9, which bumps the trial foundation from 942edaf to a93aba0.

Old address New address What a replacement costs
stackit_resourcemanager_project.backplane stackit_resourcemanager_project.foundation The project holds the project-creation service account. module.backplane keys it on the project id, and every tenant project names it as owner_email.
meshstack_landingzone.stackit_default meshstack_landingzone.this["default"] Tenants are assigned to this landing zone. metadata.name is unchanged, so the destroy and create collide on the same name.
meshstack_building_block_definition.this meshstack_building_block_definition.this["default"] Every tenant project building block instantiates this definition.

The latter two gained for_each = local.project_variants when the networked variant was added; the default key holds what the unkeyed resource held.

Checks

  • stackit_resourcemanager_project.name has no RequiresReplace in the provider, so the -backplane-foundation rename updates in place once the address moves.
  • Moving an unkeyed resource into a for_each key plans as 0 to add, 0 to change, 0 to destroy (checked on tofu with terraform_data).
  • Both roots pass tofu validate, and tofu fmt is clean.
  • Fresh deployments are unaffected: a move from an address that state does not hold does nothing.

🤖 Generated with Claude Code

Unifying the sandbox and hub-and-spoke architectures into stackit-landingzone renamed three
resources without moved blocks, so every landing zone deployed against an older ref destroys and
recreates them on the next building block run:

- stackit_resourcemanager_project.backplane -> .foundation, in the reference architecture. The
  project holds the project-creation service account, which module.backplane keys on its project id
  and which every tenant project names as its owner_email. name carries no RequiresReplace, so the
  -backplane -> -foundation rename updates in place once the address is moved.
- meshstack_landingzone.stackit_default -> .this["default"], in modules/stackit. The landing zone
  keeps its metadata.name, so this is a pure state move, but tenants are assigned to it.
- meshstack_building_block_definition.this -> .this["default"], in modules/stackit. Every tenant
  project building block instantiates this definition.

The latter two gained for_each = local.project_variants when the networked variant was added, and
the default key holds what the unkeyed resource held.

Moving an unkeyed resource into a for_each key plans as no change, and both roots validate. For
fresh deployments the moves are no-ops, because a move from an address that state does not hold does
nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Scorecard Check

No module changes detected relative to origin/main.

grubmeshi added a commit to meshcloud/trial-cloudfoundation that referenced this pull request Aug 13, 2026
The hub merged reference-architectures/stackit-sandbox-landingzone and stackit-hub-spoke into one
stackit-landingzone that takes an optional `network`, so a93aba0 has no directory at the old source
path and `tofu init` fails on it. Leaving `network` unset keeps this deployment sandbox-only.

The 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. meshcloud/meshstack-hub#256 adds them, and this pins f656771 rather than a93aba0.

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.
@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-256.d1o16zfeoh2slu.amplifyapp.com

grubmeshi pushed a commit to meshcloud/trial-cloudfoundation that referenced this pull request Aug 14, 2026
This should fix custom metering not working moving forward: a93aba0 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. Re-pin once that merges.

The role mapping comment from 41a82cc is corrected while we are here. It 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. What the cap does
buy is iam.member.add, iam.role.add and the per-product role-binding permissions, without which a
tenant cannot grant STACKIT access to people meshStack does not know about. The deletion gap is now
recorded as a known gap, together with why a custom role is not worth the 808 permission names it
would take to close it.

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>
grubmeshi pushed a commit to meshcloud/trial-cloudfoundation that referenced this pull request Aug 14, 2026
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>
@grubmeshi
grubmeshi merged commit f656771 into main Aug 14, 2026
3 checks passed
@grubmeshi
grubmeshi deleted the fix/stackit-landingzone-moved-blocks branch August 14, 2026 07:48
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