Repository navigation
fix(0-bootstrap): attach org policies to enclave folder when org-level policies disabled - #422
Open
johnlakeee wants to merge 1 commit into
Open
johnlakeee wants to merge 1 commit into
johnlakeee wants to merge 1 commit into
Conversation
…l policies disabled
8 tasks done
aghassemlouei
requested changes
Nov 17, 2026
aghassemlouei
left a comment
Member
There was a problem hiding this comment.
Thanks for putting together the folder-scoped organization policy fallback for Stage 0. Running terraform plan with deploy_org_resources.org_policies = false surfaced three issues in fast/stages-aw/0-bootstrap/organization.tf along with a pull request template gap:
- In
fast/stages-aw/0-bootstrap/organization.tfline 91,var.deploy_org_resources.org_policies ? {} : local.org_policiesfails duringterraform planwithError: Inconsistent conditional result typesbecause Terraform infersmap(any)from{}whereaslocal.org_policiesis a 68-attribute structural object whoserules[*].allow.valuestuples vary in length. Passingvar.deploy_org_resources.org_policies ? null : ...matchesmodule "organization"on line 410 becausemodules/folder/variables.tfsetsdefault = {}andnullable = falseonvariable "org_policies", andtests/test_bootstrap_folder_org_policies.pyline 52 should be updated to match? null :. - In
fast/stages-aw/0-bootstrap/organization.tflines 70 to 74,context = { condition_vars = { root_node = local.assured_workload_folder } }fails oncelocal.assured_workload_folderis known withError: Invalid value for input variable: attribute "condition_vars": element "root_node": map of string requiredbecausemodules/folder/variables.tfline 193 declarescondition_vars = optional(map(map(string)), {})rather thanmap(any). Becausedata/custom-org-policies/*.yamlare already rendered viatemplatefile(...)inorganization.tf, thecontextblock onmodule "root-folder-config"can be removed. - When
var.deploy_org_resources.org_policies = false,module "organization"setsorg_policy_custom_constraints = nullon lines 394 to 398 and skips creatingcustom.kmsRotationandcustom.restrictFirewallRanges, yetlocal.org_policiesstill includes both keys fromdata/org-policies/cloudkms_policy.yamlanddata/org-policies/networking_policy.yaml. Filtering outstartswith(k, "custom.")keys on the folder fallback when!var.deploy_org_resources.org_policiespreventsNOT_FOUNDerrors at apply time in environments where custom constraints have not been pre-created at the organization level. - Please also include the
## Deployment & Compliance Impactand## Checklistsections from.github/pull_request_template.mdin the pull request description.
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.
Description
When
deploy_org_resources.org_policies = false,module "root-folder-config"infast/stages-aw/0-bootstrap/organization.tfpreviously omitted bothorg_policiesandfactories_config.org_policies, silently dropping all Stage 0 organization policies instead of attaching them tolocal.assured_workload_folder.!var.deploy_org_resources.org_policiesinlocal.deploy_root_folder_configorg_policies,factories_config.org_policies, andcontext.condition_vars.root_node = local.assured_workload_foldertomodule "root-folder-config"tests/test_bootstrap_folder_org_policies.pyPart of #388 (Milestone 1 — Group A, PR 1 of 6).
Type of Change
Testing Performed
terraform fmt -check -recursive,terraform validate,tflint(155 directories, 0 failed)ruff check&ruff format --checkpytest: 134 passedtests/test_*.shshell suites passed