aws-api-gateway

API Gateway+Lambda+VPC timeout issue

99封情书 提交于 2021-02-05 05:57:26
问题 Good morning, Could you please help us with next problem: I have an API Gateway + Java Lambda Handler. this Lambda uses httpconnection to get some Internet REST API. when we use this Lambda without VPC it works fine. but when we are using VPC with configured internet access - sometimes Lambda fails with timeout errors. it fails in 20% of all requests (80% requests works fine) with next errors at log. REPORT RequestId: 16214561-b09a-11e6-a762-7546f12e61bd Duration: 15000.26 ms Billed Duration:

Using SAM file to remove default “Stages” in AWS ApiGateway?

ⅰ亾dé卋堺 提交于 2021-01-29 21:40:42
问题 I'm deploying a serverless application via Visual Studio using SAM file. At the end of the SAM file I've created a section of : "Type": "AWS::ApiGateway::Deployment" Which controls the deployment process : ,"APIGatewayDeploymenta727bb8729": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": "3pb9y46oll", "Description": "....", "StageName": "Royi" <-----Notice here } } },... And Indeed , it creates a stage name : "Royi": But it also create two default stages named : "Prod &

How to send parameters through AWS HTTP API to Lambda

别说谁变了你拦得住时间么 提交于 2021-01-29 07:17:15
问题 I have switched from the REST API to HTTP API for it's cost efficiency. I am a noob to AWS so please be patient with me. LAMBDA I have a simple Lambda function that returns the same value it's given. It works fine when tested from the actual Lambda console. exports.handler = async (event) => { // TODO implement const response = { statusCode: 200, body: "hello" + event["key1"] }; return response; }; When the function is tested from the Lambda console with JSON input: { "key1":"value1" }, it

can we have multiple http method in single resource in API gateway in AWS?

落爺英雄遲暮 提交于 2021-01-29 05:37:00
问题 I am trying my hands with API Gateways in AWS. Both these methods have same API end point . By default it is calling lambda function set for GET method. I feel i missed a trick here somewhere. Should i create a different Resource for PUT method or we have it in same resource with different api end point ? 回答1: Alternatively to this you could use the ANY method but you will become responsible in your Lambda for interpreting how you handle any method you do not want to support. You can set up

How API Gateway talk to Firehose VPC endpoint

孤街浪徒 提交于 2021-01-28 20:42:22
问题 Using Amazon Kinesis Data Firehose with AWS PrivateLink tells Firehose VPC endpoint keeps the traffic between VPC and Firehose within AWS. You can use an interface VPC endpoint to keep traffic between your Amazon VPC and Kinesis Data Firehose from leaving the Amazon network. When API Gateway invokes PutRecord API of Firehose via the AWS integration, does the traffic goes through the Firehose VPC endpoint or goes to the Internet? Updates The Introducing Amazon API Gateway Private Endpoints

How API Gateway talk to Firehose VPC endpoint

谁都会走 提交于 2021-01-28 19:43:02
问题 Using Amazon Kinesis Data Firehose with AWS PrivateLink tells Firehose VPC endpoint keeps the traffic between VPC and Firehose within AWS. You can use an interface VPC endpoint to keep traffic between your Amazon VPC and Kinesis Data Firehose from leaving the Amazon network. When API Gateway invokes PutRecord API of Firehose via the AWS integration, does the traffic goes through the Firehose VPC endpoint or goes to the Internet? Updates The Introducing Amazon API Gateway Private Endpoints

How to configure my Serverless YML to use my API Gateway Authorizer?

吃可爱长大的小学妹 提交于 2021-01-28 13:09:28
问题 I'm following this tutorial to use Cognito to authorize the access to my lambda function through API Gateway. I already create my user pool with a validated user, an API Gateway authorizer and a lambda function to login and get the token ID. When I get the token ID with my lambda function and test it in AWS console, the authorizer returns 200, so I think it is working, but when I try to send the token to my lambda function it returns "401 Unauthorized" My YML configuration: teste: handler:

How to configure my Serverless YML to use my API Gateway Authorizer?

柔情痞子 提交于 2021-01-28 13:07:42
问题 I'm following this tutorial to use Cognito to authorize the access to my lambda function through API Gateway. I already create my user pool with a validated user, an API Gateway authorizer and a lambda function to login and get the token ID. When I get the token ID with my lambda function and test it in AWS console, the authorizer returns 200, so I think it is working, but when I try to send the token to my lambda function it returns "401 Unauthorized" My YML configuration: teste: handler:

S3 presigned upload url error

随声附和 提交于 2021-01-28 07:00:37
问题 I am trying to perform a document upload using an S3 pre-signed PUT url. I generated the url using java AWS SDK ( GeneratePresignedUrlRequest.java ). This url generation code sits in a lambda function behind AWS API gateway. However I am getting the following error when I copy the generated url in Postman & try to perform an upload. <Error> <Code>AccessDenied</Code> <Message> There were headers present in the request which were not signed </Message> <HeadersNotSigned>host</HeadersNotSigned>

How to use IF condition in AWS Api gateway mapping templates. can i use if condition without using foreach?

杀马特。学长 韩版系。学妹 提交于 2021-01-28 05:11:13
问题 #if($inputRoot.objectType == 'Test'), "TableName": "StudentTests", #else,"TableName": "UserActions", #end if use if condition i got an error in postman link ## "__type": "com.amazon.coral.service#SerializationException" ## 回答1: The way I understand your question I would do : #if($inputRoot.objectType == "Test") #set($tableName = "StudentTests" #else #set($tableName = "UserActions" #end { "TableName": "$tableName", "Key": ... } 来源: https://stackoverflow.com/questions/55546882/how-to-use-if