You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Terraform [HTTP backend](https://www.terraform.io/docs/backends/types/http.html) that stores the state in a [Vault secret](https://www.vaultproject.io/docs/secrets/kv/kv-v2).
8
9
9
10
The server supports locking and leverages the versioning capabilities of Vault by creating a new secret version when creating/updating the state.
10
11
11
12
## Terraform config
12
13
13
-
The server authenticates to Vault using [AppRole](https://www.vaultproject.io/docs/auth/approle), with `role_id` and `secret_id` passed respectively as the `username` and `password` in the configuration.
14
+
The server authenticates to Vault using [AppRole](https://www.vaultproject.io/docs/auth/approle), with `role_id` and `secret_id` passed respectively as the `username` and `password` in the configuration:
14
15
15
16
```terraform
16
17
terraform {
@@ -25,14 +26,29 @@ terraform {
25
26
}
26
27
```
27
28
29
+
or directly with a [token](https://www.vaultproject.io/docs/auth/token):
where `<STATE_NAME>` is an arbitrary value used to distinguish the backends.
29
45
30
46
With the above configuration, Terraform connects to a vault-backend server running locally on port 8080 when loading/storing/locking the state, and the server manages the following secrets in Vault:
31
47
32
48
-`/secret/vbk/<STATE_NAME>`
33
49
-`/secret/vbk/<STATE_NAME>-lock`
34
50
35
-
The latter created when a lock is acquired and deleted when released.
51
+
the latter gets created when a lock is acquired and deleted when released.
0 commit comments