Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

betteruptime_monitor request_headers doesn't add header #19

Closed
Toilal opened this issue Feb 11, 2022 · 2 comments
Closed

betteruptime_monitor request_headers doesn't add header #19

Toilal opened this issue Feb 11, 2022 · 2 comments

Comments

@Toilal
Copy link
Contributor

Toilal commented Feb 11, 2022

I try to set request headers, but it doesn't work.

resource "betteruptime_monitor" "api_graphql" {
  url              = "https://${var.ecs_subdomain_name}.${data.cloudflare_zone.default.name}"
  monitor_group_id = local.betteruptime.betteruptime_monitor_group_id
  monitor_type     = "status"
  http_method      = "POST"
  request_body     = jsonencode({query="query {authenticated}"})
  request_headers = [{Content-Type = "application/json"}]
}

Monitor is created, but no request header is defined.

@Toilal
Copy link
Contributor Author

Toilal commented Feb 11, 2022

After reading monitor API docs, I found the right syntax

  request_headers = [{name = "Content-Type", value = "application/json"}]

That beeing said, API could check input data structure and error instead of silently omiting the request headers.

@adikus
Copy link
Contributor

adikus commented Feb 28, 2022

@Toilal Thanks for the the PR! I've merged it into master.
We'll have to discuss internally about the the API erroring out in this use case, since ignoring unknown attributes is currently our preferred default behaviour.

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

No branches or pull requests

2 participants