Approached unrecognized configuration variable sources: "self", "aws"

Serverless warns me about unrecognized variable sources aws and self. The warning obviously becomes an error when I set variablesResolutionMode: 20210326. So far I have not found any clue in the docs how those variables should be set in the future. Can you give me a hint?

serverless.yml starts like this:

service: ${self:provider.environment.solution}-MyAPI-${self:provider.environment.majorversion}

frameworkVersion: ^2.57.0

provider:
  name: aws
  runtime: nodejs14.x
  ...

This had me stumped for a while. Then I realised that it was probably using my global CLI package version. Once I updated that with npm update -g serverless, the warnings went away and I set variablesResolutionMode to 20210326.

I still get the error even after updating serverless - possibly its other plugins that need updating?

Serverless Error ----------------------------------------

Approached unrecognized configuration variable sources: “aws”

still and it appeared when I started using serverless deploy from my mac…
The ci/cd pipleline using drone deploys with no issues and this is using Linux base images…

variablesResolutionMode: 20210326 is needed as it complains of the use of aws: otherwise…

frameworkVersion is now 2.59.0

To anyone that is still running into this issue:

I have been able to fix it by downloading serverless globally and setting my node version to v15.4.0.

npm i -g serverless

Hope this helps someone in the future. :slight_smile: