serverless-offline
serverless-offline copied to clipboard
Using Fn::Join resolves to [Object Object]
Hey 😄
I'm trying to call one lambda from another one, using it's ARN. This works fine on AWS using Fn::join but it seems when using serverless-offline, it's resolved to [Object Object].
environment:
getKeyARN:
Fn::Join:
- ':'
- - 'arn:aws:lambda'
- ${self:provider.region}
- Ref: 'AWS::AccountId'
- 'function'
- ${self:service}-${self:provider.stage}-getKey
Then, when printing process.env while using serverless-offline, this shows:
getKeyARN: '[object Object]'
but should be showing the ARN obviously...
Works fine on AWS but not when running it through serverless-offline 😢
I'll see if there's a fix for this, but for now, this plugin might help you:
https://www.serverless.com/plugins/serverless-pseudo-parameters/
Ref: 'AWS::AccountId' is not going to exist in offline mode. Is that going to break your code?
I can work around it by setting it manually in serverless.yml ... So, not the end of the world. Thank you!
This bug has resurfaced after resolveJoins was removed in this refactor commit: https://github.com/dherault/serverless-offline/commit/e459110b1aa327ea8ac5b7e5d9a47bab708445ca
Reason for removal was not stated, I wonder what it is?
Agreed; no fun.
Just ran into this issue. @dnalborczyk, why was the fix removed?