简体   繁体   English

AWS lambda 函数 python/pysparkl

[英]AWS lambda function python/pysparkl

I have a lambda function that triggers when an object hits specific folder in s3 bucket and moves to different folder in the same s3 bucket.我有一个 lambda 函数,当对象命中 s3 存储桶中的特定文件夹并移动到同一个 s3 存储桶中的不同文件夹时触发。

But i am trying to modify the lambda function where the lambda triggers only if we receive all the mandatory files.(The existing lambda function i am having doesn't wait for other files ,triggers and moves whenever new file is uploaded).但我正在尝试修改 lambda 函数,其中 lambda 仅在我们收到所有必需文件时才触发。(我拥有的现有 lambda 函数不会等待其他文件,每当新文件上传时就会触发和移动)。

Could anybody help me out with this .谁能帮我解决这个问题。

Triggers do not function in this manner.触发器不会以这种方式运行。 S3 will trigger the lambda function for each file that is uploaded that matches the trigger definition as it is evaluated for every upload. S3 将为每个上传的与触发器定义匹配的文件触发 lambda 函数,因为每次上传都会对其进行评估。

If it is a timing issue, you can use stop functions.如果是计时问题,您可以使用停止功能。 S3 would trigger lambda. S3 会触发 lambda。 Lambda would trigger a step function that can wait X number of seconds/minutes/days. Lambda 会触发一个可以等待 X 秒/分钟/天的阶跃函数。 Then step functions will fire another trigger to do the operations on the S3 bucket.然后 step 函数将触发另一个触发器来对 S3 存储桶执行操作。
https://aws.amazon.com/getting-started/tutorials/create-a-serverless-workflow-step-functions-lambda/?&trk=el_a131L000005unTnQAI&trkCampaign=pac_q2-04-2019_stepfunctions_tutorial_offering_link_2&sc_channel=el&sc_campaign=pac_q2-04-2019_stepfunctions_tutorial&sc_outcome=PaaS_Digital_Marketing&sc_geo=mult https://aws.amazon.com/getting-started/tutorials/create-a-serverless-workflow-step-functions-lambda/?&trk=el_a131L000005unTnQAI&trkCampaign=pac_q2-04-2019_stepfunctions_tutorial_offering_link_2&trk_a-serverless-workflow-step-functions-lambda/?&trk=el_a131L000005unTnQAI&trkCampaign=pac_q2-04-2019_stepfunctions_tutorial_offering_link_2&tk_a-serverless-workflow-step-functions-lambda/?&trk=el_a131L000005 =多

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

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