The role defined for the function cannot be assumed by Lambda

后端 未结 11 1274
野性不改
野性不改 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:06

    I got the error "The role defined for the function cannot be assumed by Lambda" because i had not updated the roles "Trust Relationship" config file. I didn't encounter the timeout issues as in the linked answer in the comments.

    The comments in the above answers pointed out that you need to add the following.

    1. Go to 'IAM > Roles > YourRoleName'
      • (Note: if your role isn't listed, then you need to create it.)
    2. Select the 'Trust Relationships' tab
    3. Select 'Edit Trust Relationship'

    Mine ended up like the below.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          
        },
        {
          "Effect": "Allow",
          "Principal": {
            "Service": "lambda.amazonaws.com"
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
    

提交回复
热议问题