aws-api-gateway

AWS: Large File Upload - API Gateway & Lambda - Best Practices

旧城冷巷雨未停 提交于 2019-12-02 06:40:34
问题 I need a user to be able to provide a 15 MB XML file to an AWS Lambda function for it to perform an action, and return another XML file back to the user. This is the only thing this "application" is going to do. The data in the XML file is semi-sensitive and shouldn't be kept anywhere after the file is returned. What are the best practices for handling this? The API Gateway appears to have a payload size limit of 10mb, so I can't just upload it. I've seen some references to having the file

AWS: Large File Upload - API Gateway & Lambda - Best Practices

房东的猫 提交于 2019-12-02 06:14:32
I need a user to be able to provide a 15 MB XML file to an AWS Lambda function for it to perform an action, and return another XML file back to the user. This is the only thing this "application" is going to do. The data in the XML file is semi-sensitive and shouldn't be kept anywhere after the file is returned. What are the best practices for handling this? The API Gateway appears to have a payload size limit of 10mb , so I can't just upload it. I've seen some references to having the file uploaded directly to S3, and then having that action trigger the Lambda function automatically. However,

Aws Api Gateway Integration Request How to append a property to request body?

女生的网名这么多〃 提交于 2019-12-02 05:58:58
I want to combine request body and querystring parameters before sending it to lambda. Let's say I have an entity in Lambda as below : Class Person { private String firstName; private String lastName; private String language; } And the json which sent to api gateway is {"firstName":"Foo","lastName":"Bar"} As you see "language" field is missing in request body. I want to get this language field from querystring and add to json. How can I achieve tihs ? Is there a way to do in integration request section ? For example : $input.json(x).append("language":"$input.params('name')") I could not find

Reading Event Parameters AWS lambda

南笙酒味 提交于 2019-12-02 04:31:08
I have a lambda function (Node.js 4.3) as below: exports.handler = function(event, context, callback) { console.log('Received event:', JSON.stringify(event, null, 2)); var greeter = 'World'; if (event.greeter && event.greeter!=="" && event.greeter1 && event.greeter1!=="") { console.log('Received 1'); greeter = event.greeter + event.greeter1 ; } else if (event.body && event.body !== "") { console.log('Received Body'); var body = JSON.parse(event.body); if (body.greeter && body.greeter !== "") { greeter = body.greeter; } } else if (event.queryStringParameters && event.queryStringParameters

AWS: Restrict Cognito Authorized User to specific Lambda Functions

情到浓时终转凉″ 提交于 2019-12-02 02:54:34
I'm working with AWS and I've the following setup: UserPool; API Gateway, Lambda Functions The api gateway is using a UserPool authorizer to protect the lambda functions. This is working so far. Now I want to restrict every lambda function to a specific group of users. Therefore I've created two user groups in the CognitoPool ( user and admin ) and I've assigned a specific role to each group with a policy. Afterwards I've created a user in the UserPool and added him to the user group. That user is still able to submit requests to each route/lambda function. How do I submit a request? Postman

Why does my Lambda function time out even though the API Gateway callback has already been called?

会有一股神秘感。 提交于 2019-12-02 02:52:15
问题 I have an AWS API Gateway method that proxies requests through to AWS Lambda. However, it errors after three seconds with the following in the logs: Endpoint response body before transformations: {"errorMessage":"2017-09-05T16:30:49.987Z 922186c0-9257-11e7-9db3-51921d5597a2 Task timed out after 3.00 seconds"} Thus, I went on to check my Node 6.10 AWS Lambda function to see why it was timing out. I added logging statements before and after every function call. Surprisingly, it did everything

Serverless framework v1 - multiple resources in one service

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 22:23:53
I have two resources, games and players, both have crud functions. Are these supposed to be in the same serverless service? I would like to separate them, but how do I then put them in the same api gateway? A serverless framework projects deploys a single API Gateway. So if you want it to be in different API Gateways you need separate serverless framework projects. Depending on the size of the services you are making it can make sense or it might not. To merge the two API Gateways higher up you can use API Gateway Custom Domains and proxy the requests based on the path to different API

How to enable “ApiKeyRequired” property in SAM without explicit swagger definition?

丶灬走出姿态 提交于 2019-12-01 21:35:20
In cloudformation, AWS::ApiGateway::Method has a boolean property ApiKeyRequired . How can i achieve the same in SAM ? I know that we can enable using explicit swagger Configuration. which is like this { "swagger": "2.0", "info": { "version": "1.0", "title": { "Ref": "AWS::StackName" } }, "x-amazon-apigateway-api-key-source": "HEADER", "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHelloWorld.Arn}/invocations" } }, "responses": {}, "security":

API Gateway HTTP Proxy integration with serverless-offline (NOT Lambda Proxy)

你说的曾经没有我的故事 提交于 2019-12-01 20:15:27
I am trying to use serverless-offline to develop / simulate my API Gateway locally. My API gateway makes liberal use of the HTTP proxy integrations . The production Resource looks like this: I have created a serverless-offline configuration based on a few documents and discussion which say that it is possible to define an HTTP Proxy integration using Cloud Formation configuration: httpProxyWithApiGateway.md - Setting an HTTP Proxy on API Gateway by using Serverless framework. Setting an HTTP Proxy on API Gateway (official Serverless docs: API Gateway) I have adapted the above two configuration

How to Invoke AWS step function using API gateway?

北城以北 提交于 2019-12-01 18:07:46
According to Amazon's documentation, step function can be invoked using HTTP API. Step Functions can be accessed and used with the Step Functions console, the AWS SDKs, or an HTTP API. I tried to search the detailed information, but can't seem to find any good ones. Does anyone know how to invoke AWS step function using API gateway, similar to the way it invokes Lambda functions? If you need to call StepFunction from API Gateway, it's now possible and described well in docs: https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html For Integration Type, choose AWS Service