terraform-provider-checkly icon indicating copy to clipboard operation
terraform-provider-checkly copied to clipboard

Terraform reports "method" is not allowed to be empty on request url change

Open tomasz-sadura opened this issue 4 years ago • 1 comments

tf version Terraform v0.12.12

  • provider.checkly v0.6.2

Apply the following:

provider "checkly" {
  api_key = ...
}

resource "checkly_check" "api-check" {
  name = "Name"
  type = "API"

  activated = true
  should_fail = false

  frequency = 1
  double_check = true

  use_global_alert_settings = false

  degraded_response_time = 10000
  max_response_time = 30000

  locations = [
    "us-west-1",
    "eu-west-1"
  ]

  alert_settings {
    escalation_type = "RUN_BASED"

    reminders {
      amount = 0
      interval = 15
    }

    run_based_escalation {
      failed_run_threshold = 3
    }

    ssl_certificates {
      enabled = false
    }
  }

  request {
    method = "GET"
    url = "https://service.url.com/first"

    follow_redirects = true
    headers = {}
    query_parameters = {}

    body_type = "NONE"

    assertion {
      source = "STATUS_CODE"
      comparison = "EQUALS"
      target = 200
    }

    basic_auth {
      username = ""
      password = ""
    }
  }
}

Than change request url, from https://service.url.com/first to https://service.url.com/second and apply. Terraform reports:

Error: API error: unexpected response status 400: "{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"child \\\"request\\\" fails because [child \\\"method\\\" fails because [\\\"method\\\" is not allowed to be empty]]\",\"validation\":{\"source\":\"payload\",\"keys\":[\"request.method\"]}}"

tomasz-sadura avatar Jun 29 '20 14:06 tomasz-sadura

@tomasz-sadura thanks for reporting, would you mind copy & pasting this issue to https://github.com/checkly/terraform-provider-checkly so we can track it and assign someone to it?

tnolet avatar Jun 29 '20 14:06 tnolet