From 1e1b98842a3854b25f463a45f41dea30e8840e28 Mon Sep 17 00:00:00 2001 From: Seb Aebischer Date: Thu, 30 Nov 2023 16:04:59 +0000 Subject: [PATCH] fix: Use `aws:region` and `sls:stage` Serverless vars 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. --- serverless.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serverless.yml b/serverless.yml index 5bf83ce..1eea685 100644 --- a/serverless.yml +++ b/serverless.yml @@ -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: @@ -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)}