AWS Serverless template – inline policies

If you’ve worked with AWS Serverless templates, you’ll appreciate how quickly you can deploy a raft of infrastructure with very little template code. The only flaw I’ve found so far is the documentation is a bit tricky to find.

Say you want to attach some custom policies to your function, you can simply embed them into your template. E.g:

This also shows a few other neat features:

  • Wildcards in the custom policy name, allowing it to work across multiple buckets
  • Cron triggered events
  • How to set environment variables from your template

Leave a Reply

Your email address will not be published. Required fields are marked *