Add a Terraform-based alternative to CP04/CP05 (environments, groups, identity) - #36
Open
metjuperry wants to merge 1 commit into
Open
Add a Terraform-based alternative to CP04/CP05 (environments, groups, identity)#36metjuperry wants to merge 1 commit into
metjuperry wants to merge 1 commit into
Conversation
… identity) Introduces infra/ and two new checkpoint scripts, CP04b/CP05b, as a declarative alternative to CP04/CP05's imperative txc/az calls — same outcome (Dev + Test Dataverse sandboxes, OIDC deployment identity), driven by Terraform instead: - infra/environments/terraform: Dev + Test Dataverse environments, audit settings, security-team membership, and CD application-user registration - infra/groups/terraform: the environment group that holds Dev + Test — applied automatically by CP04b on first provisioning (not on later re-runs, since changing an existing environment's group is a real mutation of that resource, not something a routine re-run should trigger as a side effect) - infra/identity/terraform: the Entra app registration, service principal, and GitHub OIDC federated credential used for CI/CD, applied by CP05b - infra/tenant/terraform: tenant-wide settings, scaffold-only by design — deliberately not driven by any checkpoint, since applying it automatically would be unsafe in a tenant shared across multiple attendees/forks Run CP04+CP05 (imperative) or CP04b+CP05b (Terraform), not a mix — CP05b verifies Terraform's local state already owns the Test environment before proceeding. See infra/README.md for scope, layout, state, and cross-tier wiring details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
infra/plus two new checkpoint scripts,CP04b/CP05b, as a declarative alternative to CP04/CP05's imperativetxc/azcalls — same outcome (Dev + Test Dataverse sandboxes, OIDC deployment identity), driven by Terraform instead.What's in here
infra/environments/terraform: Dev + Test Dataverse environments, audit settings, security-team membership, and CD application-user registrationinfra/groups/terraform: the environment group that holds Dev + Test — applied automatically by CP04b the first time it provisions the environments (not on later re-runs, since changing an existing environment's group is a real mutation of that resource, not something a routine re-run should trigger as a side effect)infra/identity/terraform: the Entra app registration, service principal, and GitHub OIDC federated credential used for CI/CD, applied by CP05binfra/tenant/terraform: tenant-wide settings, scaffold-only by design — deliberately not driven by any checkpoint, since auto-applying it would be unsafe in a tenant shared across multiple attendees/forksRun CP04+CP05 (imperative) or CP04b+CP05b (Terraform), not a mix — CP05b verifies Terraform's local state already owns the Test environment before proceeding. Full details (scope, layout, local-state caveats, cross-tier wiring) in
infra/README.md.Validation
Ran the full lab checkpoint-by-checkpoint against a real tenant using this Terraform track end to end (CP01 → CP08) to shake this out, which is how the following got caught and fixed before this PR:
terraform initfailed immediately —CP04b/CP05breferenced.infra/..., but the actual directory isinfra/...(no leading dot).terraform applyfailed on the Test app-user record —test/config.ymlshipped with the literal placeholder"TODO-CHANGE-ME"fordeployment_principal_id, which is non-empty, soapp-user.tf'screate_app_user = deployment_principal_id != ""fired before a real principal existed, and Terraform tried (and failed) to parse the placeholder as a GUID.groups/terraformwas never invoked anywhere, even though the group it creates exists specifically to hold them. Now wired into CP04b as described above.terraform validatepasses in all four root modules;groups/terraformandtenant/terraform(the two designed to apply standalone) both plan cleanly against a live tenant with no vars required, matchinginfra/README.md's claim.terraform planconfirmedenvironment_group_idis an in-place update on an existing environment (not a destroy/recreate) before applying it for real.