[Bug] 0-bootstrap: essentialcontacts.managed.allowedContactDomains parameters are double-encoded (organization.tf jsonencode()s the JSON string from platform_policy.yaml) — the post-migration apply fails
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- google-cloud, terraform
- Área
- cloud, infrastructure
Línea de trabajo
Comienza por fast/stages-aw/0-bootstrap/organization.tf:139 y el valor del parámetro en fast/stages-aw/0-bootstrap/data/custom-org-policies/platform_policy.yaml:101; compara la ruta de Stage custom-org-policies con modules/organization-se/organization-policies.tf:72-74. Reprodúcelo con el segundo apply de Stage 0 de docs/ddg.md y confirma que terraform plan ya no muestra una doble codificación y que el apply tiene éxito para essentialcontacts.managed.allowedContactDomains.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Description
Since PR #210 (7a326393, first shipped in v4.0.0) the managed constraint's parameters in fast/stages-aw/0-bootstrap/data/custom-org-policies/platform_policy.yaml:101 are written as a JSON string:
essentialcontacts.managed.allowedContactDomains:
rules:
- enforce: true
parameters: '{"allowedDomains":["@${domain_name}"]}'
The stage renders that file with templatefile and formalizes each rule in 0-bootstrap/organization.tf:139:
parameters = try(jsonencode(r.parameters), null)
jsonencode of a value that is already a JSON string produces a JSON string literal — "{\"allowedDomains\":[\"@example.com\"]}" — not the object. The provider's google_org_policy_policy validates spec.rules.parameters as JSON (a string literal is valid JSON), so terraform plan accepts it, and the apply fails when the provider unmarshals the value into a map:
Error: json: cannot unmarshal string into Go value of type map[string]interface {}
with module.organization.google_org_policy_policy.default["essentialcontacts.managed.allowedContactDomains"],
on ../../../modules/organization-se/organization-policies.tf line 105, in resource "google_org_policy_policy" "default":
Because organization.tf:325 applies org policies only once bootstrap_user is unset (org_policies = var.bootstrap_user != null ? null : local.org_policies), the failure lands on the second Stage 0 apply — the one docs/ddg.md runs after the state migration and import.sh — on every deployment that follows the guide. Where the policy already exists (an organization redeployed under a new prefix), terraform plan shows it "updated in-place" from the object to the string literal, which is the clearest way to see the double encoding:
~ parameters = jsonencode(
{
- allowedDomains = [
- "@example.com",
]
}
) -> "\"{\\\"allowedDomains\\\":[\\\"@example.com\\\"]}\""
The module's own factory path (modules/organization-se/organization-policies.tf:72-74) passes templatestring(r.parameters, …) through untouched; only the stage's custom-org-policies path applies jsonencode. The essential-contacts policy is the only entry in the tree with a parameters key, so nothing else is affected.
Environment and Deployment Context
- Stellar Engine Version/Commit:
v4.0.0(6d7d08c0); the same two lines onmain(20830097, 2026-09-18). Introduced by PR #210 (2026-08-31). Providerhashicorp/googlev6.50.0. - Deployment Type:
- US Region Restricted (e.g., Access Policy constraint)
- FedRAMP Moderate
- FedRAMP High
- DoD IL4
- DoD IL5
- Stand-alone / Custom
- FAST Stage (if applicable):
- Stage 0 (Bootstrap)
- Stage 1 (Resource Management)
- Stage 2 (Networking)
- Stage 3 (Security)
Steps to Reproduce
- Follow
docs/ddg.mdthrough Stage 0: the firstterraform apply -var bootstrap_user=…, the state migration,./import.sh. terraform apply(the "one more time" apply of the guide).- Observe the error above on
google_org_policy_policy.default["essentialcontacts.managed.allowedContactDomains"]. In an organization where the policy already exists,terraform planfirst shows the in-place update from the object to the string literal.
Expected Behavior
The second Stage 0 apply completes, and the policy is set with parameters = {"allowedDomains": ["@<domain>"]} — the outcome PR #210 intended for #108.
Actual Behavior
The apply fails; the policy is not set (fresh organization) or is left as it was (redeployment). The rest of the stage's org policies apply.
Relevant Logs and Errors
See above.
Additional Context
- Fix, either form (one line):
organization.tf:139→parameters = try(r.parameters, null); or keep thejsonencodeand write the YAML value as a map,parameters: {allowedDomains: ["@${domain_name}"]}, which is presumably what thejsonencodewas written for. The first form was verified on a live deployment:terraform planthen reports no change to the policy. - Related: #108 / PR #210 (the parameters were added to fix contacts being blocked org-wide); this report is about how they are encoded, not whether they are present.
- Lenguaje dominante
- HCL
- Estrellas
- 55
- Forks
- 21
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/stellar-engine
-
[Feature Request] No research blueprint family — the README names universities as a target audience, every blueprint is FedRAMP High, FedRAMP Moderate or IL5Quizá libre de nuevo @Calvin-Cheng1 la tomó hace 32 días y no hay ningún pull request abierto. AbiertoEnhancement Level of Effort - High Priority - Low Scope - Blueprint
google/stellar-engine#239 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
[Feature Request] Remove Source Repo references and modules and replace with SSMPosiblemente ocupada @Calvin-Cheng1 la tomó hace 13 días. AbiertoEnhancement Level of Effort - High Priority - High Scope - Blueprint Scope - Fast Scope - Module
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
google/stellar-engine#198 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
[Feature Request]Customize Org Policy Enforcement Based on Regime SettingPosiblemente ocupada @aghassemlouei la tomó hace 9 días. Abiertocompliance Enhancement Framework - FedRAMP High Framework - IL5 Level of Effort - Low Priority - Medium Scope - Fast Scope - Stage 0
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
google/stellar-engine#197 ·
Los mantenedores suelen responder en 3 días
-
compliance Enhancement Framework - FedRAMP Moderate Level of Effort - High Priority - Medium Scope - Blueprint
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
google/stellar-engine#192 ·
Los mantenedores suelen responder en 3 días
-
compliance Enhancement Level of Effort - Medium Priority - Medium Scope - Blueprint Security
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
google/stellar-engine#188 ·
Los mantenedores suelen responder en 3 días
Todos los issues de google/stellar-engine
Issues similares
-
cloudflare: root entry eagerly imports `wrangler`, so `d1`/`r2`/`kvCache` cannot load without a Wrangler installPosiblemente ocupada @emdashbot la tomó hoy. Abiertoarea/cloudflare bot:bug bot:needs-attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
emdash-cms/emdash#4232 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
auto-shift/autoshiftv2#282 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
oblien/openship#1310 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
voidzero-dev/void#463 ·
Los mantenedores suelen responder en 1 día