Skip to content

Commit

Permalink
docs: secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Sep 3, 2024
1 parent ab20880 commit 9f86eb7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
11 changes: 11 additions & 0 deletions platform/src/components/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ export class SecretMissingError extends VisibleError {
* If you are not running `sst dev`, you'll need to `sst deploy` to apply the secret.
* :::
*
* #### Set a fallback for the secret
*
* You can set a _fallback_ value for the secret with the `--fallback` flag. If the secret is
* not set for a stage, it'll use the fallback value instead.
*
* ```sh title="Terminal"
* sst secret set MySecret my-fallback-value --fallback
* ```
*
* This is useful for PR environments that are auto-deployed.
*
* #### Use the secret in your app config
*
* You can now use the secret in your app config.
Expand Down
4 changes: 2 additions & 2 deletions www/src/content/docs/docs/component/aws/postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ The host of the database.
<Segment>
<Section type="parameters">
<InlineSection>
**Type** <code class="primitive">Output</code><code class="symbol">&lt;</code><code class="primitive">undefined</code><code class="symbol"> | </code><code class="primitive">string</code><code class="symbol">&gt;</code>
**Type** <code class="primitive">Output</code><code class="symbol">&lt;</code><code class="primitive">string</code><code class="symbol">&gt;</code>
</InlineSection>
</Section>
The password of the master user.
Expand Down Expand Up @@ -443,7 +443,7 @@ This is accessible through the `Resource` object in the [SDK](/docs/reference/sd
- <p><code class="key">host</code> <code class="primitive">string</code></p>
The host of the database.
- <p><code class="key">password</code> <code class="primitive">undefined</code><code class="symbol"> | </code><code class="primitive">string</code></p>
- <p><code class="key">password</code> <code class="primitive">string</code></p>
The password of the master user.
- <p><code class="key">port</code> <code class="primitive">number</code></p>
Expand Down
11 changes: 11 additions & 0 deletions www/src/content/docs/docs/component/secret.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ sst secret set MySecret my-secret-value
If you are not running `sst dev`, you'll need to `sst deploy` to apply the secret.
:::

#### Set a fallback for the secret

You can set a _fallback_ value for the secret with the `--fallback` flag. If the secret is
not set for a stage, it'll use the fallback value instead.

```sh title="Terminal"
sst secret set MySecret my-fallback-value --fallback
```

This is useful for PR environments that are auto-deployed.

#### Use the secret in your app config

You can now use the secret in your app config.
Expand Down

0 comments on commit 9f86eb7

Please sign in to comment.