The role defined for the function cannot be assumed by Lambda

后端 未结 11 1248
野性不改
野性不改 2021-02-04 23:29

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.

11条回答
  •  悲&欢浪女
    2021-02-05 00:10

    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.

提交回复
热议问题