Q:

Calling iot:attachPolicy from AWS Lambda

I'm trying to attach a policy from a AWS Lambda and I'm getting 403 with the following error:
'User: arn:aws:sts::acc-nbr:assumed-role/XXX/XXX is not authorized to perform: iot:AttachPolicy on resource: XXXX'.
I've added 'IotFullAccess' to the role selected in the lambda but the issue is still there. Any  suggestions? 
Thanks!

A:

My issue was because codestar was adding a boundary to the role, so even if I added the permission for iot:AttachPolicy, this was not inside the boundary and AWS didn't take this policy into consideration.

