Closed MorCohenAres closed 3 years ago
@MorFixAres , thanks for reporting this. Indeed, it looks like this will introduce a circular dependency. I see two possibilities to break this here:
CognitoUserPool
and confirmUser
Lamba definition. Then you don't need the !Ref
at all.!Ref
value, and once again in the Lambd functions that should NOT receive it, where you set it to an empty value for example.Hope that helps
Hi,
I think version 2.0 introduces a new bug.
It happens when you add an environment variable to a lambda function that is a reference to a circular structure.
For example, consider the following
serverless.yml
:With this yml, when you run
sls deploy
, the following error occurs:In version 1 I would simply put that variable inside the
Output
section. The alternative in version 2 is to put it on the globalprovider.environment
section, which is not possible in this case since it causes the variable to be copied into all lambda functions (and thus causing the described problem)One possible workaround is to create some "mock" function that is not a dependency of anything, and put the problematic variables there, then use
export-env --all
to collect this variable.