aws-api-gateway

AWS API Gateway with Lambda proxy always produces base64 string response

与世无争的帅哥 提交于 2020-01-22 12:28:08
问题 I'm using API Gateway Lambda proxy integration and trying to return a binary application/protobuf response. No matter what I do, the response body is always a base64 encoded string I have application/protobuf setup as a binary media types in APIG My client (javascript) is sending following headers in the POST : Accept: application/protobuf Content-Type: application/protobuf My lambda is responing with content-type: application/protobuf , and correctly setting the IsBase64Encoded Lambda

Create API gateway in localstack

本秂侑毒 提交于 2020-01-22 10:07:26
问题 I was able to setup localstack (https://github.com/atlassian/localstack) and also create lambda function in it (using create-function ... command). However, I couldnt find a way to create an APIGateway in localstack so that the lambda function can be called using it. Basically, I need an APIGateway(and its arn), so that using that the lambda function can be called. 回答1: Walkthrough for creating a NodeJS Lambda together with API Gateway per CLI: First we create a simple NodeJS Lambda: const

Issue with using bouncycastle libraries to enable TLSv1.2 for JDK1.6 running on Tomcat7

烈酒焚心 提交于 2020-01-22 02:27:52
问题 I am trying to make api calls from my apache tomcat7 server running jdk1.6 (on an aws ec2) to aws api gateway private endpoints inside my vpc. Such private endpoints only allow TLSv1.2. I am using jdk1.6.45 (which does not have TLSv1.2 support OOTB) and there is no possibility of upgrading due to other constraints. I am attempting to use bouncy castle jce and jsse providers so that I can create https connections to the api gateway using HttpsUrlConnection object. I am having issues with the

How can I bypass the 10MB limit of AWS API gateway and POST large files to AWS lambda?

自古美人都是妖i 提交于 2020-01-22 00:43:34
问题 what I want An API which takes file and some parameters using POST and gives back a JSON response. curl -X POST www.endpoint.com \ -F file=@/myfile.txt \ -F foo=bar # other params I have this working with Lambda + API gateway using binary data but 10MB limit is the issue. I have considered a POST API which uploads file to S3. The event generated is then read by Lambda. But for this I have few questions- Where will my other parameters go? How will Lambda return back the response? 回答1: Your use

How can I bypass the 10MB limit of AWS API gateway and POST large files to AWS lambda?

只谈情不闲聊 提交于 2020-01-22 00:42:30
问题 what I want An API which takes file and some parameters using POST and gives back a JSON response. curl -X POST www.endpoint.com \ -F file=@/myfile.txt \ -F foo=bar # other params I have this working with Lambda + API gateway using binary data but 10MB limit is the issue. I have considered a POST API which uploads file to S3. The event generated is then read by Lambda. But for this I have few questions- Where will my other parameters go? How will Lambda return back the response? 回答1: Your use

API Gateway 500 Response on Unhandled Exception

狂风中的少年 提交于 2020-01-17 07:29:49
问题 I have a method on an API gateway which integrates with a Python Lambda function. I would like my API Gateway to return a 500 response if an exception is raised in my Python Lambda function where the errorMessage field doesn't match one of the regex's in the Integration Response's for the method. I would only like to return a 200 if an exception is not raised and the lambda returns without failure. With the setup in the picture above - any exception raised which does not match (.|\n)*'type':

AWS Api Gateway: Missing Authentication Token

人走茶凉 提交于 2020-01-15 10:25:32
问题 So i have a Custom Domain Name setup for api gateway linked to a lambda function. I have it working fine if i do https://api_domain.com/something the behavior is as expected. Resource: /{proxy+} Base Path Mappings: / But when i go to the root domain and try to display something for that url i can't get it to work https://api_domain.com/ {"message":"Missing Authentication Token"} Searching around i found; The "Missing Authentication Token" error might be happening if you aren't adding the

Saving some info as a session in API Gateway or lambda

試著忘記壹切 提交于 2020-01-15 08:46:50
问题 I am going to design a single sign on website and in one component of my project I am using API Gateway. API Gateway is responsible to direct the to the appropriate services based on the user status so if the user is valid(the token sent from user is not expired) the related service for getting what he is requesting will be serve and if the token sent from the UI is expired then he will be sent to authorization service first. So as you noticed I need to save the tokens and their expiration

Amazon Lambda Java function returning png to API gateway [duplicate]

三世轮回 提交于 2020-01-15 04:13:10
问题 This question already has answers here : Returning binary body and http headers from an AWS lambda through API gateway (3 answers) Closed 10 months ago . I have a requirement to return a PNG from an Amazon Lambda Java Function to a Amazon Rest API. I have built the function with a function prototype like this: public static void generatePng(InputStream request, OutputStream response, Context context) The InputStream request details the information that needs to be written into the image. The

Create api-gateway lambda integration using aws-cli

北战南征 提交于 2020-01-14 09:36:06
问题 i need to create an api gateway using aws client. i suucessfully create and integrate with my aws-lambda function using web console. But iam confused with aws-client. These are the steps i followed. create api gateway and integrate with my sample lambda function using web console. Deploy created api and export as json file. Create new api gateway using exported json file using aws-cli. command like this. aws apigateway import-rest-api --body file://tmpfile.json --region us-east-1; But it