packer/website/content/docs/datasources/http.mdx

51 lines
1 KiB
Text
Raw Normal View History

2022-05-17 13:26:34 -04:00
---
description: |
The HTTP Data Source retrieves information from an HTTP endpoint to be used
2022-05-17 13:26:34 -04:00
during Packer builds
page_title: HTTP - Data Sources
2022-05-17 13:26:34 -04:00
---
<BadgesHeader>
<PluginBadge type="official" />
<PluginBadge type="hcp_packer_ready" />
</BadgesHeader>
# HTTP Data Source
2022-05-17 13:26:34 -04:00
Type: `http`
The `http` data source makes an HTTP GET request to the given URL and exports information about the response.
## Basic Example
2022-05-17 14:11:26 -04:00
```hcl
2022-05-17 13:26:34 -04:00
data "http" "example" {
url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
# Optional request headers
request_headers = {
Accept = "application/json"
}
}
2022-05-17 14:11:26 -04:00
```
2022-05-17 13:26:34 -04:00
## 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'