aws api-gateway转发请求到lambda函数卡住

时间:2017-08-20 16:05:39

标签: amazon-web-services aws-lambda aws-api-gateway amazon-iam

我对aws有点新意。我一直在尝试创建一个简单的注册表单客户端。创建了一个dynamodb和一个lambda函数,在这里写入该dynamodb是代码。问题是请求甚至没有通过日志到达lambda,它说

Execution log for request test-request
Sun Aug 20 14:33:44 UTC 2017 : Starting execution for request: test-invoke-request
Sun Aug 20 14:33:44 UTC 2017 : HTTP Method: POST, Resource Path: /mosesdb
Sun Aug 20 14:33:44 UTC 2017 : Method request path: {}
Sun Aug 20 14:33:44 UTC 2017 : Method request query string: {}
Sun Aug 20 14:33:44 UTC 2017 : Method request headers: {}
Sun Aug 20 14:33:44 UTC 2017 : Method request body before transformations: {
    "objectId": "123456789",
    "objectFullName": "asdkjh",
    "objectPhone": "1234567",
    "objectEmail": "@."
}
Sun Aug 20 14:33:44 UTC 2017 : Execution failed due to configuration error: API Gateway does not have permission to assume the provided role
Sun Aug 20 14:33:44 UTC 2017 : Method completed with status: 500

我认为这里的重要部分是

Sun Aug 20 14:33:44 UTC 2017 : Execution failed due to configuration error: API Gateway does not have permission to assume the provided role

我不明白我是否配置了API 授权无 API密钥不需要 那我为什么以及在哪里可以配置这个角色呢?我到处寻找,所有这些信息都与您使用IAM身份验证进行身份验证有关,我是否必须在客户端上使用某个角色?

1 个答案:

答案 0 :(得分:1)

请确保在API网关中添加了正确的lambda函数arn。还设置适当的角色来运行lambda函数。 Lambda基本执行角色足以获得基本权限。您可以查看以下视频,

https://youtu.be/0HwO14p9cjk