📢 Config
We are launching Config
, a set of tools to securely manage secrets and env vars in SST:
-
Constructs to define,
Config.Secret
&Config.Parameter
const STRIPE_KEY = new Config.Secret(stack, "STRIPE_KEY"); const GITHUB_TOKEN = new Config.Secret(stack, "GITHUB_TOKEN"); new Function(stack, "MyFunction", { handler: "lambda.handler", config: [STRIPE_KEY, GITHUB_TOKEN], }
-
CLI to set,
sst secrets [action]
npx sst secrets set STRIPE_KEY sk_test_abc123
-
Lambda package to fetch in a typesafe way
import { Config } from "@serverless-stack/node/config"; export const handler = async () => { console.log(Config.STRIPE_KEY); };
Learn more https://docs.sst.dev/environment-variables
Changes
Update using:
$ npx sst update v1.8.3
$ yarn sst update v1.8.3