google / google/stellar-engine
[Feature Request] FAST stages: retype essential_contacts from single-email string to the modules' full EMAIL => [types] contact map
- Dominant language
- HCL
- Stars
- 49
- Forks
- 20
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 28
Description
## Feature Description
Every stage that sets contacts declares `essential_contacts` as a plain `string` (default `null`) — `0-bootstrap/variables.tf:117`, `2-networking-a-fedramp-high:67`, `2-networking-b-il5-ngfw:59`, `3-security:42` — and configures it as `{ (var.essential_contacts) = ["ALL"] }`. This permits exactly one contact email, pinned to the `ALL` notification category, per resource. Retype it to the map the underlying modules already support.
## Use Case
The `organization`, `folder`, and `project` modules already type `contacts` as `map(EMAIL => list(NOTIFICATION_TYPES))` (valid types `ALL, SUSPENSION, SECURITY, TECHNICAL, BILLING, LEGAL, PRODUCT_UPDATES`) and `for_each` over it — the capability exists but is throttled by the stage variable. There is currently no way to register multiple contacts, or a contact scoped to a category (e.g. a billing address on `BILLING`/`SUSPENSION` only), without editing stage source. Any realistic contacts posture (separate SOC / billing / legal addresses) requires a code edit. Separately, the org-level `organization-se` call in 0-bootstrap passes no `contacts` at all, so the one place that would cascade org-wide is unused.
## Proposed Solution
Retype `essential_contacts` to `map(list(string))` (default `{}`) in each stage and pass it straight to the module `contacts` argument; add a `contacts` argument to the org-level call so an org-wide map can cascade. Backward-compatible shim:
```hcl
contacts = try(tomap(var.essential_contacts), var.essential_contacts == null ? {} : { (var.essential_contacts) = ["ALL"] })
```
## Compliance & Deployment Context
* **Target Deployment Type(s):**
* [ ] US Region Restricted (e.g., Access Policy constraint)
* [ ] FedRAMP Medium
* [ ] FedRAMP High
* [ ] DoD IL4
* [ ] DoD IL5
* [x] All / General
* **Relevant NIST 800-53r5 Controls:** SI-5 (security alerts/advisories), IR-6 (incident reporting) — category-scoped contacts let notifications reach the right teams.
## Reusability Check
Stellar Engine prioritizes reusability.
* [x] I have checked if this functionality can be achieved by extending an existing module or blueprint. (The modules already support the full map; only the stage variables throttle it.)
* [x] I have verified that this does not duplicate existing functionality.
## Alternatives Considered
Editing stage source per deployment (current workaround); documenting the limitation. Both leave a module capability inexpressible through tfvars.
## Additional Context
Verified at `main` @ `3728fc98`. Attempting the map form today fails with a type error since the variable is a `string`. A clean example of a stage variable discarding a richer module capability.
Contributor guide
Research direction
Start with the essential_contacts declarations in 0-bootstrap/variables.tf:117, 2-networking-a-fedramp-high:67, 2-networking-b-il5-ngfw:59, and 3-security:42, then inspect the organization, folder, and project module contacts types. Update the stage inputs and module calls, including the org-level organization-se call in 0-bootstrap; done means map-shaped contacts, category-scoped and multiple contacts, and the existing string form remain supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- terraform
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100