github.com/hugorut/terraform@v1.1.3/website/docs/language/settings/backends/http.mdx (about) 1 --- 2 page_title: 'Backend Type: http' 3 description: Terraform can store state remotely at any valid HTTP endpoint. 4 --- 5 6 # http 7 8 Stores the state using a simple [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) client. 9 10 State will be fetched via GET, updated via POST, and purged with DELETE. The method used for updating is configurable. 11 12 This backend optionally supports [state locking](/language/state/locking). When locking 13 support is enabled it will use LOCK and UNLOCK requests providing the lock info in the body. The 14 endpoint should return a 423: Locked or 409: Conflict with the holding lock info when it's already 15 taken, 200: OK for success. Any other status will be considered an error. The ID of the holding lock 16 info will be added as a query parameter to state updates requests. 17 18 ## Example Usage 19 20 ```hcl 21 terraform { 22 backend "http" { 23 address = "http://myrest.api.com/foo" 24 lock_address = "http://myrest.api.com/foo" 25 unlock_address = "http://myrest.api.com/foo" 26 } 27 } 28 ``` 29 30 ## Data Source Configuration 31 32 ```hcl 33 data "terraform_remote_state" "foo" { 34 backend = "http" 35 config = { 36 address = "http://my.rest.api.com" 37 } 38 } 39 ``` 40 41 ## Configuration variables 42 43 The following configuration options / environment variables are supported: 44 45 - `address` / `TF_HTTP_ADDRESS` - (Required) The address of the REST endpoint 46 - `update_method` / `TF_HTTP_UPDATE_METHOD` - (Optional) HTTP method to use 47 when updating state. Defaults to `POST`. 48 - `lock_address` / `TF_HTTP_LOCK_ADDRESS` - (Optional) The address of the lock 49 REST endpoint. Defaults to disabled. 50 - `lock_method` / `TF_HTTP_LOCK_METHOD` - (Optional) The HTTP method to use 51 when locking. Defaults to `LOCK`. 52 - `unlock_address` / `TF_HTTP_UNLOCK_ADDRESS` - (Optional) The address of the 53 unlock REST endpoint. Defaults to disabled. 54 - `unlock_method` / `TF_HTTP_UNLOCK_METHOD` - (Optional) The HTTP method to use 55 when unlocking. Defaults to `UNLOCK`. 56 - `username` / `TF_HTTP_USERNAME` - (Optional) The username for HTTP basic 57 authentication 58 - `password` / `TF_HTTP_PASSWORD` - (Optional) The password for HTTP basic 59 authentication 60 - `skip_cert_verification` - (Optional) Whether to skip TLS verification. 61 Defaults to `false`. 62 - `retry_max` / `TF_HTTP_RETRY_MAX` – (Optional) The number of HTTP request 63 retries. Defaults to `2`. 64 - `retry_wait_min` / `TF_HTTP_RETRY_WAIT_MIN` – (Optional) The minimum time in 65 seconds to wait between HTTP request attempts. Defaults to `1`. 66 - `retry_wait_max` / `TF_HTTP_RETRY_WAIT_MAX` – (Optional) The maximum time in 67 seconds to wait between HTTP request attempts. Defaults to `30`.