Open serverlessguru opened 4 years ago
Variable revolvers need to start with service token (as e.g. self:
). In you're case I think you need to refer to file:
service. See https://serverless.com/framework/docs/providers/aws/guide/variables/ for more info
Sorry, ignore my comment, I was referring to SLS v1
Currently it appears to not be possible to reference a nested state object inside the
serverless.yml
file.serverless.yml:
state file (Template.cognitoUserPool.json):
Error:
Why would you want to do this? When creating Serverless Components, you need to save state (e.g.
this.save()
) and it's much easier to logically group things together (by a key) than to have it all be flat inside theTemplate.cognitoUserPool.json
object.