Ah, my bad! I was sure I had done this with just in a policy before, but after reviewing my old code I can see that wasn’t the case - trust policies must be defined in the IAM Role.
To do this you must override the default function Role that all Serverless functions get.
Here’s what the Role resource should look like:
You then use the Role in your function definition like this (taken from the docs):
functions:
myFunction:
role: IotRole
Obviously if you want your function to do other things (like log to CloudWatch, etc), then you will need to add additional statements - you won’t get any of the defaults you usually get with the built-in Serverless function Role.