Add the join key and host resources #7
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.47) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 349 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #7"
general
weight: 0.35
jasikpark
definednet_join_key manages a reusable enrollment secret scoped to a network,
role and tags. The shape is immutable, so changing it replaces the key; name
and expires_at update in place. The token is returned only on create and is
stored sensitive in state. Hosts enrolled with a key stay outside Terraform.
definednet_host manages a host record for lighthouses, relays and other hosts
whose identity must exist before they boot. ipv4_address can be set at create
or added in place to a host without one; ip_addresses mirrors the API's list.
Enrollment codes are minted outside Terraform.
A plan-time check on both the join key and the endpoint OIDC provider rejects
an empty auto_assign_cidrs on a certificate version 1 network, where the API
always assigns IPv4. For a join key the check matters because a replace
deletes the old key before the API could reject the new one.
The host is created through POST /v2/host-and-enrollment-code so its
single-use enrollment code lands in state (sensitive) and can feed the
machine's user data. A change to the enrollment_code_triggers map mints a
new code; the triggers of an existing host must be known at plan time,
because Terraform re-plans during apply and a value resolving equal to the
stored map would keep a consumed code after the dependent machine was
destroyed. Update sends the PUT only when a field it owns changed, since the API
writes an audit entry for every PUT, and commits the add-IP and PUT results
with the previous code and triggers, so a failed mint on a blocked host
leaves the trigger change pending. GET never returns the code, so Read carries it forward and an
imported host has none until its triggers change. The lifetime is stored
only as configured; omitted, the API applies its one-day default. The
combined route needs the hosts:enroll scope as well.
Verification
go test ./...green (fake API).TF_ACC=1suite passed live against the test org, 26/26, including the host and join key tests: the combinedcreate route mints codes, a trigger change mints a fresh one, add-IP in place, out-of-band deletes, and join
keys (the JOIN_KEYS flag is on for the test org).
round on the enrollment code, and a light review of the PUT skip.
Notes for the reviewer
hosts:enrollin addition to the host scopes, becausePOST /v2/host-and-enrollment-coderequires both.
enrollment_code_triggersmust be fully known on an existing host; the planmodifier rejects unknown values with an error that says how to fix it.
expires_atis a UTC-only...Zstring compared as text; the API always returns UTC whole seconds.