AWS API Gateway messing up response: { "message": "Internal server error" } - amazon-web-services

There's a lot of questions out there pertaining to "lambda" but I haven't touched that in my life, so it probably isn't relevant to this question.
All I've done so far is import a swagger json spec into AWS API Gateway and try my best to configure it to connect to my REST api.
My issue here is that when I try calling the API gateway endpoint through the test console, everything works as expected.
But then why I try querying the same endpoint from outside AWS like any end user, I get this nondescript 500 response.
The nifty thing is that since I own the backend service, I can see the logging, which clearly indicates that a successful 200 response was returned (which should be the json response shown in the first screenshot).
So now I know that it's AWS's fault that I'm getting a 500. But I'm honestly not sure what the issue could be.
Here are all relevant configuration screens for this particular endpoint.
Method Request
Integration Request
Integration Response
Method Response
If there's any screen/setting I didn't provide that would be helpful, just let me know.
TLDR, api gateway endpoint works in online console ui, but not in real life

I follows #MarkB's advice and linked API Gateway to an IAM role with permissions to write to Cloudwatch and then here's the kicker: you have to redeploy the stage to jumpstart Cloudwatch (this is actually very poorly documented, aws).
And when I found out that I had to redeploy the gateway, that's when I also conveniently discovered that for any of the configuration changes I was making to be applied, I actually had to redeploy the entire thing.
So after redeploying, everything started to work.

Related

AWS Lambda Authorizer Missing from Method Request: Authorization options

This is my first run at the lambda jwt-authorizer so it is probably something quite trivial but...
I have tested the lambda authorizer both in AWS Lambda and in API Gateway Authorisers test rig. Both tests are successful but when I try to secure the api endpoint at the method request only AWS_IAM authorisation is available, anyone any ideas where I have went wrong?
Turns out it was a browser refresh, went away, had a game of scrabble and lovely meal with my kids. Came back, I was logged out so the browser refreshed and the authoriser was in the drop down.

Respecting an API key with Amazon's API Gateway

I'm learning serverless applications. I've created a simple Lambda that I've confirmed is working via Paw/curl.
Next I completed the API Gateway tasks of:
create a POST Resource that requires an API key
create beta and test Stages
create the API key
create a Usage Plan
associate the API key with the Usage Plan
associate the Usage Plan with the test Stage
I expect requests with the x-api-key Header to work, and those without to be denied. But I observe all requests continue to successfully finish regardless of that Header's presence.
I've recreated individual API Gateway steps and eventually the process as a whole, to no avail. Any clue of what I've missed?
I'm not seeing anything that screams of a problem. This blog walks through doing the same thing, but it results in a 403 when calling without the key. Any chance it's something simple, like you changed the "API key required" flag and didn't deploy again?

API Gateway endpoint works on AWS Console but not in browser

I have an API Gateway endpoint that proxies a Lambda function. When I test the endpoint in the console (a GET request), it works fine and returns the correct JSON.
When I try the same endpoint in the browser or Postman, it doesn't work. The error is:
server IP address could not be found
I have logs set up in CloudWatch for the API and nothing comes up, so it looks like the API is not even getting called.
I'm using the serverless framework with NodeJS. I've tried deleting my whole CloudFormation stack and redeploying from scratch but it didn't make a difference. The API was working fine until today.
I'm having the exact same issue. Specificially, Starbucks wifi doesn't like AWS API Gateway endpoints but quite a few other public wifi too. The solution is to use custom domain for the API Gateway endpoints, I'm afraid

AWS serverless url not found

I published an AWS Lambda NET solution that responded with an AWS Serverless URL:
https://je7p92w69l.execute-api.us-east-2.amazonaws.com/Prod
When I got to this link it is 404.
Check the root path for your API: your API's URL is https://je7p92w69l.execute-api.us-east-2.amazonaws.com/Prod which seems to be correct. However, haven't you mapped any API? Let's say you are creating a /books API, then you should invoke your API like https://je7p92w69l.execute-api.us-east-2.amazonaws.com/Prod/books
If you're getting 404 it just means that API Gateway is responding properly but this URI on your API does not exist. Just figure out the path you created and it will work.
On the left-hand side of your API you should see your resources, and, inside it, your URIs.

How to check Amazon SNS, Amazon API server log

I have this problem
In summary,
I send the correct request to amazon API though, It doesn't work somehow (return 400Error).
I did everything in my application side.
Now, I would like to know the Amazon Server log to research into the problem.
How can I check the amazon API server log, or is it possible?
The answer to your previous question is not entirely correct in my opinion. It's just a generic answer about HTTP 400 codes, and not very helpful in your situation. Did you look here to see the official list of error response codes from SNS and their meanings?
If you want logs of your AWS API calls you need to enable CloudTrail.