How to call AWS API Gateway Endpoint with Cognito Id (+configuration)?

后端 未结 2 1548
误落风尘
误落风尘 2021-02-08 14:11

I want to call an AWS API Gateway Endpoint that is protected with AWS_IAM using the generated JavaScript API SDK.

2条回答
  •  无人及你
    2021-02-08 15:01

    What access permissions does the role of the Cognito Identity have? Make sure it has access to perform execute-api:Invoke on your API.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "execute-api:Invoke"           
          ],
          "Resource": [
            "arn:aws:execute-api:us-east-1::/*/POST/graphql"
          ]
        }
      ]
    } 
    

    You can get the exact resource ARN from the method settings page in the web console.

提交回复
热议问题