Optional+Computed nested object unknown on create
SkillCloud & infraUse when Create fails with 'Received unknown value' on an Optional+Computed SingleNestedAttribute Path targeting a Go struct pointer. Model that field as types.Object.
Available today. Use it from your connected AI after setup.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Optional+Computed nested object unknown on create skill
What this skill tells your AI
The instructions your AI receives, as published by coralogix/terraform-provider-coralogix in .claude/skills/framework-optional-computed-nested-object/SKILL.md and read by ahel’s review.
Trigger: req.Plan.Get fails with Received unknown value… Path: <attr> Target Type: *…Model Suggested Type: basetypes.ObjectValue when the nested block is omitted from HCL.
Fix: Store the attribute as types.Object in the resource model (not *SomeModel). Decode with .As() only when !IsNull() && !IsUnknown(). Flatten with types.ObjectValueFrom / ObjectNull.
Why: Omitted Optional+Computed nested attributes are unknown on create. Go struct pointers cannot represent unknown; types.Object can.
Signals
- GitHub stars
- 22
- Forks
- 14
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
framework-optional-computed-nested-object- Source
- github.com/coralogix/terraform-provider-coralogix
github.com/coralogix/terraform-provider-coralogix