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
16
votes
4 answers

Is it possible to add an HTTP header from AWS Custom Auth on API gateway?

I am using Custom Auth on AWS API Gateway, but I would like to add an extra HTTP header depending on the result. Does anyone know if this is possible, or how to do it. If it is not, is there an idea of if or when this will be possible? Many thanks.
16
votes
4 answers

Access AWS API Gateway with IAM roles from Python

I have an AWS API Gateway that I would like to secure using IAM Roles . I am looking for a package to help me accessing it using Python. I am trying to avoid implementing the entire Version 4 Signing Process. I am sure there must be some library I…
FelixEnescu
  • 4,664
  • 2
  • 33
  • 34
16
votes
1 answer

How to create and assign API Key to a created stage-API using serverless?

I want to create a secure APIG using serverless, in my current "s-fuction.json" I've already have: "apiKeyRequired": true, And in my "s-resources-cf.json" I already have: "AWSApiKey": { "Type": "AWS::ApiGateway::ApiKey", "Properties" : { …
16
votes
1 answer

Proper Principal ID Value for API Gateway Custom Authorizer via Lambda?

I am using a new feature of the API Gateway with Lambda functions to use a Custom Authorizer (https://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html). The authorizer uses JWT Tokens to validate the token for the…
Tom Pennetta
  • 482
  • 7
  • 25
15
votes
3 answers

How to throw HTTP error code with AWS Lambda using Lambda Proxy?

I created an AWS Lambda function using Python 3.8 with a Lambda Proxy API Gateway trigger: It is indeed possible to return custom HTTP error codes: def lambda_handler(event, context): return { 'statusCode': 400, 'body':…
DurandA
  • 1,095
  • 1
  • 17
  • 35
15
votes
1 answer

Can't get API Gateway to work with private VPC link (behind a network load balancer to a Fargate container)

Can't get API Gateway to work with private VPC link (behind a network load balancer to a Fargate container) containers Hi all, I've spent the last three days trying to get this to work. My goal is to set an a POST method that redirects to a private…
15
votes
1 answer

API Gateway returning 403 - Forbidden

I have an API Gateway with an endpoint that is fulfilled by AWS Lambda proxy integration. I have also configured a custom authorizer for this endpoint. I am seeing an issue where the first request that I make to this endpoint is successful, but…
15
votes
2 answers

Obtaining a deployed API Gateway URL using awscli

I have an API that has been deployed in a stage in API Gateway. I am trying to get the URL of the deployed API using cli, but am having difficulties finding the command to do so. I have tried all the get- commands from the docs, found…
himi64
  • 1,069
  • 3
  • 12
  • 23
15
votes
2 answers

AWS API Gateway caching ignores query parameters

I'm configuring the caching on AWS API Gateway side to improve performance of my REST API. The endpoint I'm trying to configure is using a query parameter. I already enabled caching on AWS API Gateway side but unfortunately had to find out that it's…
Hleb
  • 7,037
  • 12
  • 58
  • 117
15
votes
3 answers

AWS API Gateway: Use Mock Integration to echo response body

I am trying to use the Mock integration to just "echo" back me the JSON body that I sent. However, I just can't get it to work. I can return any arbitrary JSON body from my "POST - Integration Response", but the request JSON is never found via…
user23714
  • 253
  • 3
  • 7
15
votes
4 answers

AWS Error: Proxy integrations cannot be configured to transform responses

I'm a beginner in Amazon's Lambda-API implementations. I'm just deploying a very simple API: a very simple lambda function with Python 2.7 printing "Hello World" that I trigger with API Gateway. However, when I click on the Invoke URL link, it tells…
sammtt
  • 401
  • 1
  • 6
  • 14
15
votes
2 answers

AWS API Gateway MTLS client auth

Everytime I searched for Mutual Auth over SSL for AWS API Gateway I can only find MTLS between AWS API Gateway and Backend Services. But I'm looking to secure my AWS API Gateway endpoints itself with MTLS (client auth). For instance, I have a…
15
votes
1 answer

Handling CSRF attacks from AWS Lambda?

Normally, a csrf token is generated by the server and then sent to the client. When the client submits a form, the token is passed back to the server, which then gets verified. If I am just using API Gateway and Lambda, how would I ensure that all…
15
votes
3 answers

Posting from AWS-API Gateway to Lambda

I have a simple C# Aws Lambda function which succeeds to a test from the Lambda console test but fails with a 502 (Bad Gateway) if called from the API Gateway (which i generated from the Lambda trigger option) and also if I use postman.(this initial…
Tim
  • 7,401
  • 13
  • 61
  • 102
15
votes
2 answers

AWS API Gateway / Cognito Userpools / Lambdas not able to pass caller credentials

I'm working on an AWS API Gateway implementation with a Lambda backend. I use the API Gateway integration with the Cognito Userpools (fairly new) instead of building a custom authorizer using Lambda (which was the recommended way before it was…