I\'m getting the error \"The role defined for the function cannot be assumed by Lambda\" when I\'m trying to create a lambda function with create-function command.
For me, the issue was that I had an incomplete name for the role. I set
--role arn:aws:iam::000000000000:role/MyRoleName
when it should have been
--role arn:aws:iam::000000000000:role/service-role/MyRoleName
(of course my aws id isn't actually 000000000000)
I discovered this by running
aws iam get-role --role-name MyRoleName
and looking at the "Arn"
property in the result set.