AWS Lambda gateway API gives error message

11,321

Solution 1

If you're using the latest version of Postman, you can generate the SigV4 signature automatically. The region should correspond to your API region (i.e. "us-east-1") and the service name should be "execute-api"

Postman

Solution 2

This is not a solution but it has helped me more than once:

Double-check that you are actually hitting an existing endpoint! Especially if you're working with AWS. AWS will return this error if you don't have the correct handler set up in your Lambda or if your API Gateway is not configured to serve this resource/verb/etc.

Share:
11,321

Related videos on Youtube

Ashly
Author by

Ashly

Updated on July 28, 2022

Comments

  • Ashly
    Ashly over 1 year

    I have created one API endpoint for lambda function, as - https://XXXXXXXXX.execute-api.us-east-1.amazonaws.com/XXXX/XXXXXXXXXXXX/ which is GET method.

    While calling that endpoint from postman it is giving me

    { "message": "'XXXXXXXXX3LPDGPBF33Q:XXXXXXXXXXBLh219REWwTsNMyyyfbucW8MuM7' not a valid key=value pair (missing equal-sign) in Authorization header: 'AWS XXXXXXXXX3LPDGPBF33Q:XXXXXXXXXXBLh219REWwTsNMyyyfbucW8MuM7'." }

    This is a screenshot of the Amazon Lambda Upload Site: http://i.stack.imgur.com/mwJ3w.png

    I have Access Key Id & Secret Access Key for IAM user. I used it all but no luck. Can anyone suggest tweak about this.

    • RyanG
      RyanG
      There seems to be a problem with the Sigv4 signature. How are you generating the Authorization header?
    • Ashly
      Ashly
      I am able to solve this but got stuck into following problem - "message": "Credential should be scoped to correct service: 'execute-api'." This is a screenshot : i.stack.imgur.com/J5OvT.png Following is the format I used to create Authoraziation Header - AWS4-HMAC-SHA256 + Credential=AccessKeyId/timezoneArea/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=SecretAccessKey
  • Ashly
    Ashly over 7 years
    This actually solves the problem ryan. You have saved my couple of days. Thank you so much.
  • user2779653
    user2779653 over 2 years
    that was it for me!