Hi there,
Noticed that a wrong type was used for keys payload and headers in the web hook configuration
Got an error that payload and headers should be string which is not so according to the API documentation with example below
{
"base_url": "http://test.com",
"auth_username": "username",
"auth_password": "password",
"payload_type": "application/json",
"payload": {"account_id": 1, "account_name": "account name" },
"headers": {"header1": "test", "header2": "test"}
}
v0.11.10
Please list the resources as a list, for example:
2018-11-14T12:54:29.861+0400 [DEBUG] plugin.terraform-provider-newrelic_v1.2.0_x4: 2018/11/14 12:54:29 [INFO] Reading New Relic alert channel 2024412
2018/11/14 12:54:32 [ERROR] root: eval: *terraform.EvalRefresh, err: newrelic_alert_channel.this: [DEBUG] Error setting Alert Channel Configuration: &errors.errorString{s:"configuration.payload: '' expected type 'string', got unconvertible type 'map[string]interface {}'"}
2018/11/14 12:54:32 [ERROR] root: eval: *terraform.EvalSequence, err: newrelic_alert_channel.this: [DEBUG] Error setting Alert Channel Configuration: &errors.errorString{s:"configuration.payload: '' expected type 'string', got unconvertible type 'map[string]interface {}'"}
2018/11/14 12:54:32 [TRACE] [walkRefresh] Exiting eval tree: newrelic_alert_channel.this
2018/11/14 12:54:32 [DEBUG] plugin: waiting for all plugin processes to complete...
Error: Error refreshing state: 1 error(s) occurred:
2018-11-14T12:54:32.015+0400 [DEBUG] plugin.terraform-provider-newrelic_v1.2.0_x4: 2018/11/14 12:54:32 [ERR] plugin: plugin server: accept unix /var/folders/mr/6gwkzzjs4nldgm7gf2dbj6yw0000gn/T/plugin499091540: use of closed network connection
2018-11-14T12:54:32.015+0400 [DEBUG] plugin.terraform-provider-aws_v1.43.2_x4: 2018/11/14 12:54:32 [ERR] plugin: plugin server: accept unix /var/folders/mr/6gwkzzjs4nldgm7gf2dbj6yw0000gn/T/plugin205253133: use of closed network connection
* newrelic_alert_channel.this: 1 error(s) occurred:
2018-11-14T12:54:32.018+0400 [DEBUG] plugin: plugin process exited: path=/Users/oba/.terraform.d/plugins/darwin_amd64/terraform-provider-newrelic_v1.2.0_x4
2018-11-14T12:54:32.019+0400 [DEBUG] plugin: plugin process exited: path=/Users/oba/.terraform.d/plugins/darwin_amd64/terraform-provider-aws_v1.43.2_x4
* newrelic_alert_channel.this: newrelic_alert_channel.this: [DEBUG] Error setting Alert Channel Configuration: &errors.errorString{s:"configuration.payload: '' expected type 'string', got unconvertible type 'map[string]interface {}'"}
payload and headers should be a map
Please list the steps required to reproduce the issue, for example:
main.tfresource "newrelic_alert_channel" "this" {
name = "example"
type = "webhook"
configuration = {
base_url = "https://example.com/runbook_url"
payload_type = "application/json"
payload = "${map("account_id","$ACCOUNT_ID")}"
headers = "${map("X-Insert-Key","my_key")}"
}
}
terraform applyHello, are there any updates on this bug?
+1 looking for a bug fix
+1
Yeah I hit this whenever I try to read in a webhook with a custom payload