Does SST support reading secrets from SSM?
# help
v
Does SST support reading secrets from SSM?
f
Can you share your use case? ie. are you trying to read it and set it in Lambda environment variable?
s
I used @aws-cdk/aws-ssm directly, fetched variables and made them available to my sst.Api via environment variables
Copy code
import * as ssm from "@aws-cdk/aws-ssm";
import * as sst from "@serverless-stack/resources";
const secret = ssm.StringParameter.valueFromLookup(
      this,
      "super_secret_variable"
    );
new sst.Api(this, "api", {
      defaultFunctionProps: {
        environment: {
          my_secret: secret
        }
      }
       // other stuff omitted
    });
f
Yup exactly like what @Seth Geoghegan did