• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Packer
  • Install
  • Tutorials
  • Documentation
  • Guides
  • Plugins
  • Try Cloud(opens in new tab)
  • Sign up
Packer Home

Documentation

Skip to main contentOverview
  • HCP Packer

  • Terminology

    • Overview
    • HTTP

  • Installing Packer
  • Configuring Packer

  • Integration Program

  • Debugging

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Packer
  3. Documentation
  4. Data Sources
  5. HTTP
  • Packer
  • v1.7.x
  • v1.6.x
  • v1.5.x
Official
HCP Packer Ready

ยปHTTP Data Source

Type: http

The http data source makes an HTTP GET request to the given URL and exports information about the response.

Basic Example

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

  # Optional request headers
  request_headers = {
    Accept = "application/json"
  }
}

Configuration Reference

Configuration options are organized below into two categories: required and optional. Within each category, the available options are alphabetized and described.

Required:

  • url (string) - The URL to request data from. This URL must respond with a 200 OK response and a text/* or application/json Content-Type.

Not Required:

  • request_headers (map[string]string) - A map of strings representing additional HTTP headers to include in the request.

Datasource outputs

The outputs for this datasource are as follows:

  • url (string) - The URL the data was requested from.

  • body (string) - The raw body of the HTTP response.

  • request_headers (map[string]string) - A map of strings representing the response HTTP headers. Duplicate headers are concatenated with, according to RFC2616.

Edit this page on GitHub

On this page

  1. HTTP Data Source
  2. Basic Example
  3. Configuration Reference
  4. Datasource outputs
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)