fix: Populate immutable workload identity fields on import #132
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 278 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #132"
general
weight: 0.35
sdahal-bt
Description
Importing a
beyondtrust_auth_workload_identityalways planned a destroy and recreate.Readdeliberately keepsservice_name,issuer_urlandidp_categoryfrom prior state, because the auth service lower-cases some of these in storage and echoing them back would cause spurious diffs. After an import, though, those fields are null, and all three force replacement, so every import planned a replace. A replace gives the identity a newidentityId. For identities whose conditions are managed outside Terraform, it also resets them to the config's seed values, so their workloads stop authenticating.Change
applyReadnow fills these three fields from the API response when the state value is null. That only happens on the firstReadafterImportState. All three areRequired, so after a create they always hold config values. Refresh behaviour for managed resources is unchanged."".ImportStateVerifyIgnorefor these fields, so it now checks that they round-trip exactly.importblock (ImportStateKind: resource.ImportBlockWithID) against the same config. The step fails if the import plans anything other than a no-op.Behaviour notes
Motivation
This unblocks adopting existing, unmanaged workload identities into Terraform state for the platform-eventing tenant-onboarding stack.
Jira tickets and links
[ON-6764]: https://beyondtrust.atlassian.net/browse/ON-6764?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ