Files
opentf/website/docs/language/settings/backends/http.html.md
Chris Arcand f521ba6cd7 Remove 'enhanced' backend type distinction
As explained in the changes: The 'enhanced' backend terminology, which
only truly pertains to the 'remote' backend with a single API (Terraform
Cloud/Enterprise's), has been found to be a confusing vestige which need
only be explained in the context of the 'remote' backend.

These changes reorient the explanation(s) of backends to pertain more
directly to their primary purpose, which is storage of state snapshots
(and not implementing operations).

That Terraform operations are still _implemented_ by the literal
`Backend` and `Enhanced` interfaces is inconsequential a user of
Terraform, an internal detail.
2021-12-07 16:29:51 -06:00

71 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
layout: "language"
page_title: "Backend Type: http"
sidebar_current: "docs-backends-types-standard-http"
description: |-
Terraform can store state remotely at any valid HTTP endpoint.
---
# http
Stores the state using a simple [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) client.
State will be fetched via GET, updated via POST, and purged with DELETE. The method used for updating is configurable.
This backend optionally supports [state locking](/docs/language/state/locking.html). When locking
support is enabled it will use LOCK and UNLOCK requests providing the lock info in the body. The
endpoint should return a 423: Locked or 409: Conflict with the holding lock info when it's already
taken, 200: OK for success. Any other status will be considered an error. The ID of the holding lock
info will be added as a query parameter to state updates requests.
## Example Usage
```hcl
terraform {
backend "http" {
address = "http://myrest.api.com/foo"
lock_address = "http://myrest.api.com/foo"
unlock_address = "http://myrest.api.com/foo"
}
}
```
## Data Source Configuration
```hcl
data "terraform_remote_state" "foo" {
backend = "http"
config = {
address = "http://my.rest.api.com"
}
}
```
## Configuration variables
The following configuration options / environment variables are supported:
* `address` / `TF_HTTP_ADDRESS` - (Required) The address of the REST endpoint
* `update_method` / `TF_HTTP_UPDATE_METHOD` - (Optional) HTTP method to use
when updating state. Defaults to `POST`.
* `lock_address` / `TF_HTTP_LOCK_ADDRESS` - (Optional) The address of the lock
REST endpoint. Defaults to disabled.
* `lock_method` / `TF_HTTP_LOCK_METHOD` - (Optional) The HTTP method to use
when locking. Defaults to `LOCK`.
* `unlock_address` / `TF_HTTP_UNLOCK_ADDRESS` - (Optional) The address of the
unlock REST endpoint. Defaults to disabled.
* `unlock_method` / `TF_HTTP_UNLOCK_METHOD` - (Optional) The HTTP method to use
when unlocking. Defaults to `UNLOCK`.
* `username` / `TF_HTTP_USERNAME` - (Optional) The username for HTTP basic
authentication
* `password` / `TF_HTTP_PASSWORD` - (Optional) The password for HTTP basic
authentication
* `skip_cert_verification` - (Optional) Whether to skip TLS verification.
Defaults to `false`.
* `retry_max` / `TF_HTTP_RETRY_MAX` (Optional) The number of HTTP request
retries. Defaults to `2`.
* `retry_wait_min` / `TF_HTTP_RETRY_WAIT_MIN` (Optional) The minimum time in
seconds to wait between HTTP request attempts. Defaults to `1`.
* `retry_wait_max` / `TF_HTTP_RETRY_WAIT_MAX` (Optional) The maximum time in
seconds to wait between HTTP request attempts. Defaults to `30`.