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
28
votes
1 answer

Deploy multiple API Gateway stages with AWS CDK

API Gateway has the concept of stages (e.g: dev, test, prod), and deploying multiple stages via the AWS Console is very straightforward. Is it possible to define and deploy multiple stages with AWS CDK? I've tried but so far it does not seem…
Darragh Enright
  • 13,676
  • 7
  • 41
  • 48
28
votes
2 answers

AWS API Gateway + Elastic Beanstalk and Microservices

I'm going to build microservices' architecture on AWS and I want to ask you to clarify my doubts. My current general concept I would like to use API Gateway, which exposes microsevices' APIs running in Elastic Beanstalk. I would like to place the…
27
votes
3 answers

Cognito user pool authorizer With Serverless Framework

I need to authorize my API end point using aws cognito userpool. I can do it manually, but I need to automate the authorization part with the serverless framework. Does the Serverless framework have support for aws cognito? If so, how do we setup…
27
votes
1 answer

API Gateway + Lambda + Python: Handling Exceptions

I'm invoking a Python-based AWS Lambda method from API Gateway in non-proxy mode. How should I properly handle exceptions, so that an appropriate HTTP status code is set along with a JSON body using parts of the exception. As an example, I have the…
Alastair McCormack
  • 26,573
  • 8
  • 77
  • 100
27
votes
6 answers

How can I send multiple Set-Cookie headers from API Gateway using a proxied Lambda

I'm using API Gateway's Proxy integration to call a Lambda. The output format specification is this follow JSON format: { "statusCode": httpStatusCode, "headers": { "headerName": "headerValue", ... }, "body": "..." } In one response I wish to…
sihil
  • 2,563
  • 1
  • 17
  • 24
26
votes
4 answers

Which type do I return with AWS lambda responses in typescript to suite AWS APIGateway Method Response?

I want to build a proper typescript project on AWS lambda. Right now, I am having the following definitions: export type HttpResponse = { statusCode: number; headers: {}; body: string; } export async function readCollection (event, context,…
wzr1337
  • 3,609
  • 5
  • 30
  • 53
26
votes
4 answers

AWS Api Gateway + Lambda + custom domain (Route53) Missing Authentication Token issue

I am aware that many similar questions have been posted and answered here but none of them is quite the same with what I am experiencing. I have a Lambda function that handles incoming requests (GET and POST). I also set up an api gateway as public…
jlai
  • 909
  • 1
  • 10
  • 17
26
votes
5 answers

how to make AWS api gateway accept http instead of https

I have a Lambda function proxied by API Gateway. However, API Gateway only expose https and not http. I searched everywhere but looks like API Gateway is not possible to accept http. So my question is how to translate http client calls to https and…
Frank Luo
  • 283
  • 1
  • 3
  • 8
26
votes
3 answers

How can I grant permission to API Gateway to invoke lambda functions through CloudFormation?

I've been all over the web searching for an answer to this. Essentially, we're spinning up an API using Swagger, which is awesome and works great, but one thing doesn't work... When we make a call to an Endpoint, we get a 500 error (it's not a 500…
26
votes
9 answers

AWS API-Gateway communicating to SNS

I am building an API which will be serviced by Lambda functions but I need these to be asynchronous so rather than connecting the API-Gateway directly to the Lambda function I'm using the "AWS Service Proxy" to publish SNS messages and then have the…
ken
  • 8,763
  • 11
  • 72
  • 133
26
votes
3 answers

Does API Gateway automatically validate input model?

I've created simple API in AWS API gateway with following endpoint: POST /v1/users In method execution / method request I've added request model: This model schema looks like this: However when I make a request to that endpoint with json body {…
user606521
  • 14,486
  • 30
  • 113
  • 204
25
votes
4 answers

Is there a way to assign a Static IP to a AWS Lambda without VPC?

I am looking to assign a static IP to my Lambda which is being invoked via the API gateway. This is required because, the downstream system that i invoke from this lambda accepts web requests only from a Whitelisted IP. I am successful in achieving…
25
votes
1 answer

Respond then continue working with AWS Lambda/API Gateway?

I currently have a Web hook that's calling AWS API Gateway -> AWS Lambda function proxy. I'd like to make the web hook more responsive and return an early reply while continuing processing in the Lambda. I went ahead and did this early reply from…
ss2k
  • 1,258
  • 1
  • 13
  • 20
25
votes
1 answer

Is it possible to query an Amazon RDS instance directly from API Gateway?

I'm new to API Gateway, and as far I have tried is a really powerful tool. For the project I'm working right now we are using a PostgreSQL instance in RDS. I've seen that is possible to access directly to DynamoDB tables from API Gateway, so I was…
Camilo Ortegón
  • 3,414
  • 3
  • 26
  • 34
25
votes
6 answers

AWS API Gateway and Lambda to return image

Say I have this HTML: What I would like to do is have example.com/pic map to an AWS API Gateway endpoint. That endpoint would then call a lambda function. That lambda function would read a random image from an s3…
user1736191
  • 313
  • 1
  • 3
  • 7