I have deployed an API Gateway via the Serverless Framework with a default IAM role (apis-gateway-dev-apiDefaultRole) that contains a set of permissions. Each lambda function is declared separately, and does not have an IAM role defined in serverless.yml.
If I understand correctly, Serverless now generates minimal lambda IAM roles to each lambda fn (eg app-apis-fn-dev-fn), assigns them minimal permissions to write logs, but then assumes permissions from the default role.
My lambda functions now throw AccessDenied errors:
[ERROR] ClientError: An error occurred (AccessDeniedException) when calling the GetParameter operation: User: arn:aws:sts::************:assumed-role/app-apis-fn-dev-region-lambdaRole/app-apis-fn-dev-fn is not authorized to perform: ssm:GetParameter ...
app-apis-fn-dev-region-lambdaRole is the minimal role autogenerated by Serverless. It doesn't have permissions. The permissions are in apis-gateway-dev-apiDefaultRole
This seems to imply to me that the lambda is not assuming the apiDefaultRole - is that correct? How do I troubleshoot this?
The worst bit is it worked fine before some fairly major changes I made earlier today, but the role definitions were one of the few parts that were not changed... I know I've broken it, please help me work out how!