Questions tagged [aws-api-gateway]

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

With a few clicks in the AWS Management Console, you can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any Web application.

Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management. Amazon API Gateway has no minimum fees or startup costs, and you pay only for the API calls you receive and the amount of data transferred out.

Amazon API Gateway product page

What is Amazon API Gateway?

7665 questions
498
votes
23 answers

How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

for instance if we want to use GET /user?name=bob or GET /user/bob How would you pass both of these examples as a parameter to the Lambda function? I saw something about setting a "mapped from" in the documentation, but I can't find that setting in…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
452
votes
21 answers

Can an AWS Lambda function call another

I have 2 Lambda functions - one that produces a quote and one that turns a quote into an order. I'd like the Order lambda function to call the Quote function to regenerate the quote, rather than just receive it from an untrusted client. I've looked…
Silver
  • 4,911
  • 3
  • 15
  • 16
211
votes
27 answers

Missing Authentication Token while accessing API Gateway?

I am trying to call a Lambda Function through AWS API Gateway. When I mention Authentication type NONE it works fine but API become public and anyone with url can access my API. To make API call secure, I am using Authentication type AWS_IAM and…
Umer Waheed
  • 4,044
  • 7
  • 41
  • 62
171
votes
7 answers

API gateway vs. reverse proxy

In order to deal with the microservice architecture, it's often used alongside a Reverse Proxy (such as nginx or apache httpd) and for cross cutting concerns implementation API gateway pattern is used. Sometimes Reverse proxy does the work of API…
user1459144
  • 4,439
  • 5
  • 28
  • 35
169
votes
24 answers

API Gateway CORS: no 'Access-Control-Allow-Origin' header

Although CORS has been set up through API Gateway and the Access-Control-Allow-Origin header is set, I still receive the following error when attempting to call the API from AJAX within Chrome: XMLHttpRequest cannot load…
Tyler
  • 3,616
  • 3
  • 22
  • 34
136
votes
19 answers

AWS lambda api gateway error "Malformed Lambda proxy response"

I am trying to set up a hello world example with AWS lambda and serving it through api gateway. I clicked the "Create a Lambda Function", which set up the api gatway and selected the Blank Function option. I added the lambda function found on AWS…
jjbskir
  • 8,474
  • 9
  • 40
  • 53
136
votes
6 answers

Getting json body in aws Lambda via API gateway

I'm currently using NodeJS to build a bot on AWS lambda via AWS Api Gateway and I'm running into an issue with POST requests and JSON data. My api uses 'Use Lambda Proxy integration' and even when I test the proxy sending a content-type of…
TommyBs
  • 9,354
  • 4
  • 34
  • 65
136
votes
32 answers

getting message: forbidden reply from AWS API gateway

I am trying to create a lambda service on AWS and have it accessed from outside via the API gateway with no authentication or restriction required. To make things easy I set the gateway for now to be a Mock. On the Get method of the API, the…
Fab
  • 1,745
  • 2
  • 8
  • 11
121
votes
12 answers

Using an API key in Amazon API Gateway

I have created an API Key and added it to my functions. I have then deployed the api and tested it but still get: "message": "Forbidden" How do I pass the api key with my JSON request as I have been using "x-api-key": "theKey"?
cdub
  • 24,555
  • 57
  • 174
  • 303
121
votes
12 answers

Is there a way to change the http status codes returned by Amazon API Gateway?

For instance if I want to return a specific 400 error for invalid parameters or perhaps a 201 when the lambda function call resulted in a create. I'd like to have different http status codes but it looks like api gateway always returns a 200 status…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
107
votes
1 answer

Regional/Edge-optimized API Gateway VS Regional/Edge-optimized custom domain name

This does not make sense to me at all. When you create a new API Gateway you can specify whether it should be regional or edge-optimized. But then again, when you are creating a custom domain name for API Gateway, you can choose between the…
Mehran
  • 15,593
  • 27
  • 122
  • 221
89
votes
7 answers

aws api gateway & lambda: multiple endpoint/functions vs single endpoint

I have an AWS api that proxies lamba functions. I currently use different endpoints with separate lambda functions: api.com/getData --> getData api.com/addData --> addData api.com/signUp --> signUp The process to manage all the endpoints and…
Chris
  • 13,100
  • 23
  • 79
  • 162
82
votes
7 answers

How can I retrieve a user's public IP address via Amazon API Gateway + Lambda (node)

I'm currently writing a Node.js lambda function, in which I want to log the incoming requester's public IP address. I've been looking through both the API Gateway and Lambda docs all day, but haven't found a solution. Does the lambda event object…
rdegges
  • 32,786
  • 20
  • 85
  • 109
82
votes
12 answers

Amazon API gateway timeout

I have some issue with API gateway. I made a few API methods, sometimes they work longer than 10 seconds and Amazon returns 504 error. Here is screenshot below: Please help! How can I increase timeout? Thanks!
81
votes
14 answers

message: "Internal server error" when try to access aws gateway api

Created Lambda Hello world function using Node.js and created API GateWay trigger for Get call, tried the URL to access Lambda function, getting below error. message: "Internal server error". (very new to AWS)
user1671308
  • 859
  • 2
  • 8
  • 11
1
2 3
99 100