AWS LAMBDA计划任务 [英] AWS Lambda Scheduled Tasks

查看:2491
本文介绍了AWS LAMBDA计划任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亚马逊宣布AWS LAMBDA( http://aws.amazon.com/lambda/ )。

Amazon announced AWS Lambda (http://aws.amazon.com/lambda/).

该产品描述包括:

任务计划

AWS lambda函数可以通过外部事件定时器触发,所以   功能可以在定期维护时间运行或   非高峰时段。例如,您可以触发一个AWS LAMBDA功能   在非繁忙时间进行夜间存档清理。

AWS Lambda functions can be triggered by external event timers, so functions can be run during regularly scheduled maintenance times or non-peak hours. For example, you can trigger an AWS Lambda function to perform nightly archive cleanups during non-busy hours.

在我写这篇文章,我明白我终于可以有办法始终做到类似cron任务。我想运行一个特定的查询,每天下午5点我们说。

When I read this, I understood I could finally have a way to consistently do "cron-like" tasks. I want to run a specific query everyday at 5PM let's say.

不过,我不觉得这是任何地方的文件中。他们只提上programatical事件触发,或事件与其他AWS服务。

However I do not find this anywhere in the documentation. They only mention triggers on programatical events, or events from other AWS services.

难道我误会?或者,可以有人点我的文档?

Did I misunderstand? Or can someone point me to the documentation?

推荐答案

的补充2015年10月8日的预定活动的原生支持:

AWS <一href="https://aws.amazon.com/blogs/aws/aws-lambda-update-python-vpc-increased-function-duration-scheduling-and-more/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A%20AmazonWebServicesBlog%20%28Amazon%20Web%20Services%20Blog%29">announced今天LAMBDA现在支持计划的职能从控制台中,有CLI和API航线即将推出。他们也支持所谓的计划事件新的​​事件源类型,可以是pssed作为一个速率或一个cron EX pression EX $ P $,这表现在从链接的博客帖子这个图片:

AWS announced today that Lambda now supports scheduled functions from the console, with CLI and API routes coming soon. They are supported as a new event source type called "Scheduled Event", and can be expressed as a rate or a cron expression, as demonstrated in this image from the linked blog post:

AWS还提供了一个使用cron的EX pression称为样本蓝图λ-金丝雀,可以创建函数的自AWS控制台中进行选择。你可以认为这是一个例子,你会也想使用的cron()而不是率()能恩preSS要每天下午5时运行的功能。

AWS has also provided a sample "blueprint" that uses a cron expression called lambda-canary that can be selected during function creation from the AWS console. You can view this as an example, and you'll likewise want to use cron() instead of rate() to express that you want to run the function every day at 5pm.

像任何其他事件源,安排的活动可以添加/查看/仅在选定特定的功能和导航到事件来源选项卡中创建从AWS控制台的功能之后进行修改。

Like any other event source, scheduled events can be added/viewed/modified after creating the function from the AWS console by merely selecting the function and navigating to the 'Event Source' tab.

原来的答复(仍然相关,CLI / API的用户,直到支持添加到这些产品)

在AWS之一:重新改造的LAMBDA 2014年会议期间Q&功放的发言者指出,一个是定时事件是待办事项清单上,而不是产品尚未推出。对于当前的时间,他们建议使用SWF 创建一个定时器,或创建一个定时器在其他地方。

During one of the AWS:reInvent 2014 sessions on Lambda the speaker noted during Q&A that timed events are on the to-do list and not available yet. For the current time, they recommended using SWF to create a timer, or to create a timer somewhere else.

在定时事件的评论,可以发现在这个记录在42min 50secs 开始使用AWS拉姆达的。

The comment on timed events can be found in this recording of "Getting Started with AWS Lambda" at 42min 50secs.

这篇关于AWS LAMBDA计划任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆