aws-lambda

Where does one configure mapping templates in AWS API Gateway or Lambda?

笑着哭i 提交于 2019-12-12 04:37:56
问题 I see many people talk about using mapping templates in the form of json object to make user agents and ip addresses available to Lambda functions? Where are these json objects configured in the many control panels? 回答1: Api gateway -> your api -> your endpoint/resource method -> integration request -> body mapping templates Create one with a valid Content-type header such as application/json You can then pick a template or roll your own map. For example the template which maps everything

AWS Lambda and Multipart Upload to/from S3

人盡茶涼 提交于 2019-12-12 04:33:56
问题 Using Lambda to move files from an S3 to our Redshift. The data is placed in the S3 using an UNLOAD command directly from the data provider's Redshift. It comes in 10 different parts that, due to running in parallel, sometimes complete at different times. I want the Lambda trigger to wait until all the data is completely uploaded before firing the trigger to import the data to my Redshift. There is an event option in Lambda called "Complete Multipart Upload." Does the UNLOAD function count as

How to get the path param value in java AWS Lambda function

情到浓时终转凉″ 提交于 2019-12-12 04:32:38
问题 URL: /test/{userName} In AWS Lambda function , How can I get the {username} path parameter value. I am calling lambda function through AWS API gaetway . 回答1: If you are using AWS integration type: Use a mapping template to send $input.params('username') property in the request body to your Lambda function. If you are using AWS_PROXY integration type: You can access the path parameters via the "pathParameters" property of the incoming event. 来源: https://stackoverflow.com/questions/41762462/how

What event can be triggered to fire a lambda function in DynamoDB?

落花浮王杯 提交于 2019-12-12 04:24:20
问题 I can't seem to find the documentation on what kinds of events DynamoDB is able to trigger a lambda function based on. All I can find is mentions of when a new record is added to a table or a record is updated. Are those the two "only" actions/events available? Or could I also trigger a lambda function when I request a records that does not exists (which is what I need in my case, where I will be using DynamoDB as a cache)? 回答1: Triggering a Lambda function automatically because somebody

How to add executable packages in AWS Lambda

不羁的心 提交于 2019-12-12 04:21:43
问题 Is there any way to add executable packages like gcc, g++ or jdk on aws lambda and then execute our lambda function. 回答1: Everything that you include in your lambda zip file is deployed in /var/task in the lambda execution. By this way, you can add your binary in the zip and retrieve it in your code invoking the path /var/task/. Remember that your binary should be compiled with static option, to avoid errors due dependencies. 回答2: From https://aws.amazon.com/blogs/compute/running-executables

Code reuse of .NET 4.0 DLL (that uses Nuget packages) with .NET CORE

▼魔方 西西 提交于 2019-12-12 04:07:55
问题 I spent a few days writing a class library of .DLL functions in .NET 4.0. Now I want to call it from an AWS Lambda function using .NET Core. Apparently, we cannot reference from CORE to .NET Framework; get this error: In my class library, I used every Nuget package I could to save time and make my code small. So even if I convert my class library to CORE, I would have to now rewrite each of the Nuget packages? Seems like we really don't have code re-use here. Am I missing some shortcut here,

Lambda function issue in AWS iOS Sdk

南楼画角 提交于 2019-12-12 04:07:06
问题 I'm new to deal with AWS web services, i'm working with open-identity sending DeveloperAuthProviderName and Token in login dictionary of AWSCognitoCredentialsProvider class and then in a viecontroller i'm invoking a lambda funtion and its giving me error below. I have used CognitoSyncDemo App and also tried with importing all frameworks through pod but result is same. Please help me out of this. AWSiOSSDKv2 [Error] AWSCredentialsProvider.m line:435 | __73-[AWSCognitoCredentialsProvider

How to return 1*1 pixel as response from AWS Lambda? [duplicate]

爱⌒轻易说出口 提交于 2019-12-12 03:16:39
问题 This question already has answers here : AWS API Gateway base64Decode produces garbled binary? (3 answers) Closed 7 months ago . I am trying to get 1*1 pixel as response from my AWS Lambda . code is like this : var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b'; var imgBuffer = new Buffer(imgHex, 'hex'); context.succeed({header:"image/png",data:img}); And i mapped response header in API Gateway . But it does't give 1*1 pixel as response. 回答1:

S3 files being processed multiple times in AWS Lambda

帅比萌擦擦* 提交于 2019-12-12 03:13:45
问题 I have a Java Lambda function that is triggered by S3 Event every 15 minutes. I've noticed that over the period of about every 3 hours, each Lambda call includes the latest file that was uploaded AND all of the files that were uploaded before it within that 3 hour timespan. So, if the when iterating through the entire List, it repeats the files that had already been processed in an earlier Lambda call. How do I get it to only process the most recent file uploaded? In node.js, there is a

Parameter Validation for AWS Api Gateway

旧街凉风 提交于 2019-12-12 02:49:14
问题 So I created a resource and a GET action on my Api Gateway. I correctly pass my url parameters through Method Execution and through Integration Request via Mapping Templates. Currently I am having my Api endpoint execute a Lambda function when hit and there are parameter validates in my Lambda function. I was hoping there would be a way for Api Gateway to tell me validate the url parameters for me. But I can't find any documentation or blog that teaches me how to do that. I heard in a