简体   繁体   English

AWS Lambda函数和S3

[英]AWS lambda function & S3

I'm trying to write a lambda function in Node.js 6.10 on AWS that gets triggered when an object is uploaded into S3 and I have no idea where to even begin. 我正在尝试在AWS的Node.js 6.10中编写一个lambda函数,该函数在将对象上载到S3中时被触发,我什至不知道从哪里开始。 Can someone please help? 有人可以帮忙吗?

Below is the post from AWS guys on the same scenario. 以下是来自AWS专家在相同场景下的帖子。
https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html

The idea is simple, You need to configure events on the S3 bucket to invoke your lambda. 这个想法很简单,您需要在S3存储桶上配置事件以调用lambda。 These events for your case should be put and multi-part complete. 针对您的案例的这些事件应该放在多部分中。

Below is the screenshot of event configuration 以下是事件配置的屏幕截图

在此处输入图片说明

You can find events under properties tab of the S3 bucket 您可以在S3存储桶的“属性”标签下找到事件

Use SAM (Serverless Application Model). 使用SAM(无服务器应用程序模型)。 Here's some info: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#s3 这是一些信息: https : //github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#s3

Here's where you can find an actual example of the code and the SAM template: https://github.com/awslabs/serverless-application-model/tree/develop/examples/apps/s3-get-object 在这里,您可以找到代码和SAM模板的实际示例: https : //github.com/awslabs/serverless-application-model/tree/develop/examples/apps/s3-get-object

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM