Skip to content

Do not replace building_block_v2 when inputs change #141

@grubmeshi

Description

@grubmeshi

Problem

When a user changes any input value on a meshstack_building_block_v2 resource, Terraform plans a full destroy + create cycle because:

  1. The inputs map has a RequiresReplace plan modifier (building_block_common.go:56)
  2. The resource's Update method unconditionally returns an error: "Building blocks can't be updated" (building_block_v2_resource.go:315)

This is because the meshBuildingBlock meshObject API (POST/DELETE only) does not support PUT/PATCH — there is no way to update inputs on an existing building block via the current API.

Impact

Destroying and recreating a building block on every input change:

  • Loses the building block's run history and outputs
  • Triggers an unnecessary delete run followed by a create run
  • Can cause downtime for dependent infrastructure managed by the building block runner
  • Breaks parent/child building block relationships that reference the old UUID

Proposed fix

This will be addressed by the new meshstack_building_block_v3 resource, which should support in-place input updates by triggering a new building block run rather than replacing the entire building block. This likely requires a corresponding API change in meshStack to support updating building block inputs (or a dedicated "retrigger run" mechanism).

Metadata

Metadata

Assignees

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