API Gateway does not have permission to assume the provided role DynamoDB

荒凉一梦 提交于 2019-12-11 06:09:10

问题


I'm trying to follow this tutorial, but when I try to test the API I've created, I get the following message:

API Gateway does not have permission to assume the provided role

The API request should be posting to a DynamoDB table I've created.

I've created an IAM Role and attached the policy AmazonDynamoDBFullAccess. I've also tried attaching this policy to my administrator user.

Here is the integration request in my API:

Any help is much appreciated.


回答1:


The ARN you have provided for the IAM Role is a policy. It needs to be a role. Please go to your generated role and update your ARN to that. It should look something like this *:role/AmazonDynamoDBFullAccess-201709151726




回答2:


Below worked for me

Go to IAM > Roles > whateverRole > Trust Relationships > Edit Trust Relationship and add apigateway under Statements

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

Assisted by this guy https://histerr.blogspot.com/2016/06/api-gateway-does-not-have-permission-to.html?showComment=1549214559316#c3046645274286738526



来源:https://stackoverflow.com/questions/46282781/api-gateway-does-not-have-permission-to-assume-the-provided-role-dynamodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!