diff --git a/env.example b/env.example deleted file mode 100644 index 2f82df7..0000000 --- a/env.example +++ /dev/null @@ -1,12 +0,0 @@ -# HOW TO USE: -# -# 1 Add environment variables for the various stages here -# 2 Rename this file to env.yml and uncomment it's usage -# in the serverless.yml. -# 3 Make sure to not commit this file. - -dev: - APP_NAME: serverless-nodejs-starter - -prod: - APP_NAME: serverless-nodejs diff --git a/serverless.yml b/serverless.yml index 2778a99..6f56213 100644 --- a/serverless.yml +++ b/serverless.yml @@ -18,6 +18,9 @@ custom: webpack: webpackConfig: ./webpack.config.js includeModules: true + # Load our secret environment variables based on the current stage. + # Fallback to default if it is not in prod. + environment: ${file(env.yml):${self:custom.stage}, file(env.yml):default} provider: name: aws @@ -30,6 +33,7 @@ provider: environment: tableName: Ref: NotesTable + stripeSecretKey: ${self:custom.environment.stripeSecretKey} iamRoleStatements: - Effect: Allow