splunk / terraform-provider-splunk

Terraform Provider for Splunk
Mozilla Public License 2.0
103 stars 75 forks source link

splunk_inputs_http_event_collector throws error `trying to unmarshal "true" into int` #130

Open vj-joshi opened 2 years ago

vj-joshi commented 2 years ago

We are trying to create hec using Splunk's terraform provider but it fails with following error: json: invalid use of ,string struct tag, trying to unmarshal "true" into int

Details: Splunk Provider version = "1.4.13" terraform version = "1.2.2"

Terraform block to create resource:

resource "splunk_inputs_http_event_collector" "hec-token" {
  name     = "test-hec-token"
}

Splunk Cloud Details:

Version: 8.2.2201.1
Experience: Victoria

Error while running tf apply: image

krakmendy commented 1 year ago

We're facing the same issue:

Error: json: invalid use of ,string struct tag, trying to unmarshal "false" into int
with splunk_inputs_http_event_collector.test,
on inputs_http.tf line 1, in resource "splunk_inputs_http_event_collector" "test":
1: resource "splunk_inputs_http_event_collector" "test" {

Terraform version: v1.1.7 Splunk provider version: 1.4.15 Splunk Enterprise: 8.2.2203.4

@anushjay

spurge commented 1 year ago

We're also facing this issue. So, I wonder, is this prioritized somehow, as this issue was created in June? And did you @vj-joshi or @krakmendy solved this with any workaround?

I guess it's related to the ack field which is exptected as a string and then converted to an int, but received as a bool. Perhaps the backend was updated, but this Terraform provider code wasn't?

https://github.com/splunk/terraform-provider-splunk/blob/0cb4f0706dfc0dea10c5ec89fae192e98341a5db/client/models/http_event_collector.go#L23