Skip to content

SINGLE_SELECT and STATIC inputs cause "unexpected new value" error in MANUAL building block definitions #176

@JohannesRudolph

Description

@JohannesRudolph

Description

When creating a meshstack_building_block_definition with implementation.manual that includes inputs of type SINGLE_SELECT or with assignment_type = "STATIC", the provider returns an "unexpected new value" error on apply.

The API automatically creates corresponding outputs for these input types even though they are not declared in the Terraform configuration. This causes a plan/apply mismatch because Terraform detects new elements that appeared in the state after apply.

Error

produced an unexpected new value:
  .version_spec.outputs: new element "single_select" has appeared.
  .version_spec.outputs: new element "static_note" has appeared.

Minimal Reproduction

run "reproduces_single_select_provider_bug" {
  expect_failures = [meshstack_building_block_definition.repro]
}

resource "meshstack_building_block_definition" "repro" {
  metadata = {
    owned_by_workspace = "my-workspace"
    tags               = {}
  }

  spec = {
    display_name = "repro-single-select"
    description  = "Reproduces provider bug with SINGLE_SELECT and STATIC inputs."
    target_type  = "WORKSPACE_LEVEL"
    readme       = "Reproduction case."
  }

  version_spec = {
    draft         = true
    deletion_mode = "PURGE"
    implementation = {
      manual = {}
    }
    inputs = {
      single_select = {
        assignment_type   = "USER_INPUT"
        display_name      = "Single Select"
        selectable_values = ["option1", "option2"]
        type              = "SINGLE_SELECT"
      }
      static_note = {
        assignment_type = "STATIC"
        display_name    = "Static Note"
        type            = "STRING"
        argument        = jsonencode("A static note value")
      }
    }
    # outputs intentionally omitted — the API creates them automatically,
    # causing the mismatch
    outputs = {}
  }
}

Desired Behavior

The provider should not produce an "unexpected new value" error. Either:

  • The API should not auto-create outputs for SINGLE_SELECT / STATIC inputs, or
  • The provider should read back and reconcile the auto-created outputs so that the post-apply state matches the plan.

Currently the only workaround is to explicitly declare a matching output for every SINGLE_SELECT or STATIC input in the Terraform configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions