Skip to content

Commit

Permalink
fix: Use aws:region and sls:stage Serverless vars
Browse files Browse the repository at this point in the history
Removes the need for conditional/fallback logic in `provider.region`
and `provider.stage`. Existing logic for `region` was flawed, since it
ignored the CLI `--region` option. These two keys now simply store the
defaults.
  • Loading branch information
seb-cr committed Nov 30, 2023
1 parent a0fe7db commit 1e1b988
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ provider:
runtime: nodejs18.x
memorySize: 128
timeout: 60
region: ${env:AWS_REGION, env:AWS_DEFAULT_REGION, 'eu-west-1'}
stage: ${opt:stage, 'dev'}
region: eu-west-1
stage: dev
versionFunctions: false

stackTags:
Expand All @@ -23,8 +23,8 @@ provider:
environment:
EPSAGON_TOKEN: ${env:EPSAGON_TOKEN, ""}
EPSAGON_SERVICE_NAME: ${env:EPSAGON_SERVICE_NAME, ""}
REGION: ${self:provider.region}
STAGE: ${self:provider.stage}
REGION: ${aws:region}
STAGE: ${sls:stage}

functions:
- ${file(./serverless/functions/hello.yml)}
Expand Down

0 comments on commit 1e1b988

Please sign in to comment.