Dashboard variablesv2 wire shape

SkillCloud & infra

Use 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.

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)
  • id string ↔ UUID{Value: ...} via ExpandDashboardUUID
  • promql query string ↔ PromQlQuery{Value: ...} via ExpandPromqlQuery
  • dataprime query string ↔ CommonDataprimeQuery{Text: ...}
  • observation scope short name ↔ DATASET_SCOPE_* via existing enum maps
  • spans value = { type, value } ↔ SpanField via ExpandSpansField / FlattenSpansField
  • metrics operator {type, selected_values} ↔ {equals|notEquals: {selection: {list: ...}}}
  • empty metrics label_filters → omit/nil (avoid null↔[] drift)
  • empty value_display_options: schema AtLeastOneOfChildren rejects {} (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 (VariableV2 id/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 with requiredEnumValue / derefOrZero / ValueString(), flatten by address (&variable.Source) and types.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). Never UseStateForUnknown — needed for omit→set→omit and omit→value-change. Expand still copies value if 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