Skip to content

Comments

Fix: Recommend using jsondecode(file(...)) for widgets to avoid false diffs#34

Open
daihiraoka wants to merge 1 commit intoinstana:mainfrom
daihiraoka:fix/widgets-jsonencode-doc
Open

Fix: Recommend using jsondecode(file(...)) for widgets to avoid false diffs#34
daihiraoka wants to merge 1 commit intoinstana:mainfrom
daihiraoka:fix/widgets-jsonencode-doc

Conversation

@daihiraoka
Copy link

Fix: Recommend using jsondecode(file(...)) for widgets to avoid false diffs

Context

This PR updates the documentation to recommend using jsondecode(file(...)) followed by jsonencode(...) for the widgets property in instana_custom_dashboard.

Using file() alone leads to string formatting mismatches, which cause Terraform to produce plan diffs unnecessarily—even when no real changes exist.

Example warning:

.widgets: planned value ... does not match config value ...

This behavior, while currently tolerated due to the legacy plugin SDK, may lead to future issues or breaking changes.

Changes

  • Updated example usage in documentation
  • Added comment explaining why jsonencode(jsondecode(file(...))) is preferred

Result

Users will now see examples that produce cleaner, idempotent Terraform plans and avoid confusion during deployments.

Fixes

Fixes #33

Thanks for reviewing!

docs: recommend jsondecode/file for widget input
@daihiraoka daihiraoka changed the title Update custom_dashboard.md Fix: Recommend using jsondecode(file(...)) for widgets to avoid false diffs Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

widgets = file(...) causes non-idempotent behavior due to string mismatch

1 participant