7
votes

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.

2
There seems to be a problem with the Sigv4 signature. How are you generating the Authorization header?RyanG
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=SecretAccessKeyAShly
Do anyone know how to create Authorization header for iam user with aws4_request & timezone us-east-1AShly

2 Answers

11
votes

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

11
votes

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.