Provides an HTTP backend for terraform
Requires version >= 3.35.0
Server is configured via environment variables:
DATABASE_URI
- File path for database; defaults to/var/lib/terraform-http-backend/state.db
HTTP_PORT
- Port on which server listens; defaults to8080
HTTP_BIND_ADDRESS
- Address on which server binds; defaults to0.0.0.0
LOG_LEVEL
- Defines the level at (or above) which messages are logged.
The following environment variables must be defined:
TF_HTTP_USERNAME
- HTTP username used for basic authenticationTF_HTTP_PASSWORD
- HTTP password used for basic authentication
Specify the following backend, populating the relevant fields. Refer to Terraform documenation here for more configuration options.
terraform {
backend http {
address = "http://localhost:8080/terraform/${resource_identifier}"
lock_address = "http://localhost:8080/terraform/${resource_identifier}/lock"
unlock_address = "http://localhost:8080/terraform/${resource_identifier}/lock"
lock_method = "POST"
unlock_method = "DELETE"
}
}