From 9f86eb77578526eb5c119bcaf93a474f0e02397d Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 3 Sep 2024 14:01:37 -0400 Subject: [PATCH] docs: secrets --- platform/src/components/secret.ts | 11 +++++++++++ www/src/content/docs/docs/component/aws/postgres.mdx | 4 ++-- www/src/content/docs/docs/component/secret.mdx | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/platform/src/components/secret.ts b/platform/src/components/secret.ts index cecb4e1ab..d2cd87726 100644 --- a/platform/src/components/secret.ts +++ b/platform/src/components/secret.ts @@ -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. diff --git a/www/src/content/docs/docs/component/aws/postgres.mdx b/www/src/content/docs/docs/component/aws/postgres.mdx index 0145b30fe..718180bcc 100644 --- a/www/src/content/docs/docs/component/aws/postgres.mdx +++ b/www/src/content/docs/docs/component/aws/postgres.mdx @@ -388,7 +388,7 @@ The host of the database.
-**Type** Output<undefined | string> +**Type** Output<string>
The password of the master user. @@ -443,7 +443,7 @@ This is accessible through the `Resource` object in the [SDK](/docs/reference/sd -

host string

The host of the database. --

password undefined | string

+-

password string

The password of the master user. -

port number

diff --git a/www/src/content/docs/docs/component/secret.mdx b/www/src/content/docs/docs/component/secret.mdx index bfd282c03..b7c404e0d 100644 --- a/www/src/content/docs/docs/component/secret.mdx +++ b/www/src/content/docs/docs/component/secret.mdx @@ -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.