I’d like to enforce functions writing to specific logs, as well, would like to ensure that a specific IAM role is being used. I can’t seem to find references on how these things can get specified, any tips?
I have to lock down the policies that serverless will use, giving admin access is not an option.
Here’s the error I am currently getting for lack of being able to do this:
for roles it is also useful to checkout the serverless plugin serverless-iam-roles-per-function, which allows you for each function to add its needed permissions and per default a role with default lambda execution permissions plus the once you specified are generated.
For the log groups, if you use the “name” property for each function then you get a log stream with /aws/lambda/ which works but i’m not sure if the path /aws/lambda is also changeable.
Here is a partial sample of a function’s yml file: