Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.49 KB

File metadata and controls

59 lines (43 loc) · 1.49 KB
page_title Provider: HTTP
description The HTTP provider interacts with HTTP servers.

HTTP Provider

The HTTP provider is a utility provider for interacting with generic HTTP servers as part of a Terraform configuration.

Example Usage

This provider requires no configuration, but accepts an optional host configuration.

Providing host-specific configuration at the provider level

# Ensure an 'Accept: application/json' header is present on all
# checkpoint-api.hashicorp.com requests.
provider "http" {
  # Optional host configuration
  host {
    name = "checkpoint-api.hashicorp.com"

    request_headers = {
      Accept = "application/json"
    }
  }
}

data "http" "example" {
  url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
}

Schema

Optional

Nested Schema for host

Required:

  • name (String) The hostname for which the host configuration should take affect. If the name matches an HTTP request URL's hostname, the provider's host configuration takes affect (in addition to any data- or resource-specific request configuration.

Optional:

  • request_headers (Map of String, Sensitive) A map of request header field names and values to include in HTTP requests if/when the request URL's hostname matches the provider host configuration name.