Dashboard variablesv2 wire shape
SkillCloud & infraUse when expanding/flattening coralogix_dashboard variables_v2, or editing static values[].label defaults. Build typed SDK VariableV2 structs from flat TF models; wrap value/label, promql, dataprime, scope, and spans shapes.
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 Dashboard variablesv2 wire shape skill
What this skill tells your AI
The instructions your AI receives, as published by coralogix/terraform-provider-coralogix in .claude/skills/dashboard-variables-v2-wire-shape/SKILL.md and read by ahel’s review.
Trigger: Editing variables_v2 expand/flatten (variables_v2.go) or static values[].label schema/plan modifier (dashboard_schema/variables_v2.go).
Fix: Keep Terraform UX flat, then build typed SDK models (not map[string]any JSON):
- value arms →
SingleStringValue{Value: &StringValueLabel{...}}(same for regex/lucene/interval/numeric) idstring ↔UUID{Value: ...}viaExpandDashboardUUID- promql
querystring ↔PromQlQuery{Value: ...}viaExpandPromqlQuery - dataprime
querystring ↔CommonDataprimeQuery{Text: ...} - observation
scopeshort name ↔DATASET_SCOPE_*via existing enum maps - spans
value = { type, value }↔SpanFieldviaExpandSpansField/FlattenSpansField - metrics operator
{type, selected_values}↔{equals|notEquals: {selection: {list: ...}}} - empty metrics
label_filters→ omit/nil (avoid null↔[] drift) - empty
value_display_options: schemaAtLeastOneOfChildrenrejects{}(Framework cannot plan null when config keeps the block; omit the block or set a regex) - empty
multi_string.list.values→ flatten known empty list, not null (values is Required) - enums (
display_type, order, refresh, data_mode) →OptionalEnumPointer(never pointer-to-empty) - OpenAPI-required fields (
VariableV2id/name/display_name/display_type/source/value, static/query all_option + values_order_direction, ValueLabel value/label, AllOption.include_all, logs FieldValue.observation_field, metrics LabelValue.label_name) are non-pointer SDK values — expand withrequiredEnumValue/derefOrZero/ValueString(), flatten by address (&variable.Source) andtypes.StringValue/types.BoolValue. TF schema stays Optional+Computed+Default where already defaulted; do not re-mark schema Required just because the Go type lost*. - static
values[].label: Optional+Computed +StaticValueLabelFromValue(omit → plan=value). Flatten always stores API label (incl. label==value). NeverUseStateForUnknown— needed for omit→set→omit and omit→value-change. Expand still copiesvalueif label null/unknown. On flatten, fill missing oneof siblings as null from schema AttrTypes (API omits unset arms).
Why: OpenAPI types nest wrappers and proto enums; flat TF fields must be wrapped into typed SDK structs or the API returns 400 / ObjectValueFrom fails. Label defaults via plan (not flatten-to-null) so omit, custom, explicit label=value, and value changes all round-trip without drift.
Signals
- GitHub stars
- 22
- Forks
- 14
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
dashboard-variables-v2-wire-shape- Source
- github.com/coralogix/terraform-provider-coralogix
github.com/coralogix/terraform-provider-coralogix