简体   繁体   English

aws lambda 发送定时 http 请求

[英]aws lambda sending a timed http request

I am new to AWS lambda.我是 AWS lambda 的新手。 Will like to seek advice from the experts here.想请教这里的专家。 I understand that Lambda is activated based on a trigger.我了解 Lambda 是基于触发器激活的。 If I wanted to send a timed http request (for example, send a http request 4 hours later), is there any recommendations to do it.如果我想发送一个定时的http请求(例如4小时后发送一个http请求),有没有什么建议可以这样做。

Yes, you can configure scheduled AWS Lambda Triggers using Cloudwatch.是的,您可以使用 Cloudwatch 配置预定的 AWS Lambda 触发器。

Tutorial: Schedule AWS Lambda Functions Using CloudWatch Events 教程:使用 CloudWatch Events 安排 AWS Lambda 函数

To create a rule using the console使用控制台创建规则

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/https://console.aws.amazon.com/cloudwatch/打开 CloudWatch 控制台
  2. In the navigation pane, choose Events, Create rule.在导航窗格中,选择事件、创建规则。
  3. For Event Source, do the following:对于事件源,执行以下操作:

    a.一种。 Choose Schedule.选择计划。

    b.Choose Fixed rate of and specify the schedule interval (for example, 5 minutes).选择 Fixed rate of 并指定计划间隔(例如,5 分钟)。

  4. For Targets, choose Add target, Lambda function.对于目标,选择添加目标、Lambda 函数。

  5. For Function, select the Lambda function that you created.对于函数,选择您创建的 Lambda 函数。

  6. Choose Configure details.选择配置详细信息。

  7. For Rule definition, type a name and description for the rule.对于规则定义,键入规则的名称和描述。

  8. Choose Create rule.选择创建规则。

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

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