Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(r/trigger): handle state error with equivalent query_json (#593)
## Which problem is this PR solving? We received a bug report when using "r/trigger"'s `query_json` attribute handling properly handling equivalent query specifications (e.g. filter order changed, or the default "AND" filter combination was provided). The error looked something like this: ``` Error: Provider produced inconsistent result after apply When applying changes to honeycombio_trigger.example, provider "provider[\"registry.terraform.io/honeycombio/honeycombio\"]" produced an unexpected new value: .query_json: was cty.StringVal("{\"calculations\":[{\"op\":\"COUNT\"}],\"filters\":[{\"column\":\"http.status_code\",\"op\":\"\\u003e=\",\"value\":400},{\"column\":\"trace.parent_id\",\"op\":\"does-not-exist\"}],\"filter_combination\":\"AND\",\"time_range\":900}"), but now cty.StringVal("{\"calculations\":[{\"op\":\"COUNT\"}],\"filters\":[{\"column\":\"http.status_code\",\"op\":\"\\u003e=\",\"value\":400},{\"column\":\"trace.parent_id\",\"op\":\"does-not-exist\"}],\"time_range\":900}"). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` The 'fix' here is to use the same approach "r/query" takes with `query_json` and use the planned value while relying on the planmodifier to manage unnecessary diffs.
- Loading branch information