dcos_service_http_request

Resource: dcos_service_http_request

Performs an HTTP request to a DC/OS service, exposed through the Admin Router.

Example Usage

# POST some data to an HTTP service 
resource "dcos_service_http_request" "some_config" {
  service_name = "my-service"
  path         = "/configure"
  method       = "POST"

  header {
    name  = "Content-Type"
    value = "application/json"
  }

  body = <<EOF
    {
        "setting-a": "foo",
        "setting-b": "bar"
    }
EOF
}

Argument Reference

The following arguments are supported

  • service_name (Required) The name of the DC/OS service to target. This is the same as the marathon app id without the leading path (eg. my-group/my-service).
  • path (Optional, defaults to /) The path under the exposed service endpoint to access (including the leading slash). The final URL will be composed as: https://<cluster>/service/<service><path>.
  • method (Optional, defaults to GET) The HTTP method to use for performing this request. Can be any valid HTTP verb (eg. “GET”, “POST”, “PUT”, “DELETE”) etc.
  • body (Optional) The raw body of the HTTP request.
  • run_on (Optional, defaults to create) Specify when to perform the HTTP request. There are two options: * create: Perform the HTTP request when the resource is created. * delete: Perform the HTTP request when the resource is deleted.