mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-28 12:31:32 -05:00
50 lines
1 KiB
Text
50 lines
1 KiB
Text
---
|
|
description: |
|
|
The HTTP Data Source retrieves information from an HTTP endpoint to be used
|
|
during Packer builds
|
|
page_title: HTTP - Data Sources
|
|
---
|
|
|
|
<BadgesHeader>
|
|
<PluginBadge type="official" />
|
|
<PluginBadge type="hcp_packer_ready" />
|
|
</BadgesHeader>
|
|
|
|
# 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
|
|
|
|
```hcl
|
|
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:
|
|
|
|
@include 'datasource/http/Config-required.mdx'
|
|
|
|
### Not Required:
|
|
@include 'datasource/http/Config-not-required.mdx'
|
|
|
|
## Datasource outputs
|
|
|
|
The outputs for this datasource are as follows:
|
|
|
|
@include 'datasource/http/DatasourceOutput.mdx'
|