Skip to content

Commit b17bf20

Browse files
committed
Add README.md file
Signed-off-by: tpmccallum <[email protected]>
1 parent 3f3d754 commit b17bf20

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

examples/vault-variable-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
anyhow = "1"
13-
spin-sdk = { path = "../../sdk/rust" }
13+
spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v2.1.0" }
1414

1515
[workspace]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
This example relates to the [Vault Application Variable Provider Example](https://developer.fermyon.com/spin/v2/dynamic-configuration#vault-application-variable-provider-example) documentation.
2+
3+
You are best to visit the above link for more information, but for convenience, below is the steps taken to set up the Vault side of the application:
4+
5+
1. [Install Vault](https://developer.hashicorp.com/vault/tutorials/getting-started/getting-started-install)
6+
7+
2. Start Vault:
8+
9+
```bash
10+
vault server -dev -dev-root-token-id root
11+
```
12+
13+
3. Set a password:
14+
15+
```bash
16+
export VAULT_TOKEN=root
17+
export VAULT_ADDR=http://127.0.0.1:8200
18+
vault kv put secret/password value="test_password"
19+
vault kv get secret/password
20+
```
21+
22+
4. Build the application:
23+
24+
```bash
25+
spin build
26+
```
27+
28+
5. Run the application:
29+
30+
```bash
31+
spin up --runtime-config-file runtime_config.toml
32+
```
33+
34+
6. Test the application:
35+
36+
```bash
37+
curl -i http://127.0.0.1:3000
38+
```

0 commit comments

Comments
 (0)