Image for a hint

Assume you don't know how to write something in serverless.yml. Or you are not sure. Or you wrote it but it still not working.

Here is the idea:

If you could know how others do it you would be able to make the same, right?

And it is possible.

For example, you don't know how to specify bucket resources in the Policy attached. But you know that there might be tons of opensource projects which use serverless and need to grant s3:PutObject to be able to upload the file into S3 bucket.

So just go to GitHub and type in search:

Searching using GitHub

Scroll down to any file named serverless.yml and you will see this:

Example in code

We were looking for serverless.yml file, because they guarantee that framework is serverless. Raw CloudFormation files might also have .yml extension but in same time they are not fully compatible with serverless. E.g. they use Sub function which allows to substitute variables using '${var}' but $-rs clash with serverless variables. BTW there is even plugin that overcomes it by using # instead of $