Skip to content

[Bug] elasticstack_kibana_action_connector .webhook fails with "inconsistent result after apply" when headers = null is present #1522

@StephanBenning

Description

@StephanBenning

Describe the bug
The elasticstack_kibana_action_connector resource with connector_type_id = ".webhook" fails during terraform apply when the config JSON includes headers = null. The provider errors with "Provider produced inconsistent result after apply," indicating a bug related to handling of null values in the config.

To Reproduce
Steps to reproduce the behavior:

  1. TF configuration used:
resource "elasticstack_kibana_action_connector" "webhook" {
  connector_id      = "webhook-connector-id"
  connector_type_id = ".webhook"
  name              = "Hello webhook connector. (Terraform managed)"
  space_id          = "foo"

  config = jsonencode({
    authType = "webhook-authentication-basic"
    hasAuth  = true
    headers  = null
    method   = "post"
    url      = "https://foo.com/webhook"
  })

  secrets = (sensitive value)
}
  1. TF operations to execute to get the error: terraform apply
  2. See the error in the output:
Error: Provider produced inconsistent result after apply

When applying changes to elasticstack_kibana_action_connector.webhook, provider
"provider[\"registry.terraform.io/elastic/elasticstack\"].foo" produced an unexpected new value: .config was
cty.StringVal("{\"authType\":\"webhook-authentication-basic\",\"hasAuth\":true,\"headers\":null,\"method\":\"post\",\"url\":\"https://foo.com/webhook\"}"), but now
cty.StringVal("{\"__tf_provider_connector_type_id\":\".webhook\",\"authType\":\"webhook-authentication-basic\",\"hasAuth\":true,\"method\":\"post\",\"url\":\"https://foo.com/webhook\"}").

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Expected behaviour
Terraform apply should succeed without errors. The provider should handle null values in config JSON gracefully, either by normalising or safely ignoring them, without triggering inconsistent state or apply failure.[1]

Debug output
TF_LOG=trace logs confirm the provider mishandles null in the headers field, causing state mismatches after apply. All sensitive credentials are redacted.

Screenshots
N/A

Versions (please complete the following information):

  • Terraform Version: 1.13.0
  • Provider version: elastic/elasticstack >= 0.12.2
  • Elasticsearch Version: 8.19

Additional context
Workaround: Remove the headers = null setting from the .webhook connector config or omit it entirely if not required, which prevents this error and allows apply to succeed. This bug relates to provider's null value handling in JSON config and should be fixed to accept or reject null cleanly.[2]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions