SlideShare a Scribd company logo
1 of 34
Download to read offline
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Guy Davies, Sophos Ltd.
October 2015
CMP407
Lambda as Cron
Scheduling Invocations in AWS Lambda
About me
• Guy Davies, Senior Systems Engineer, Sophos Ltd
Sophos use AWS extensively in our operations to support our anti-
malware, anti-spam, and threat-detection software and hardware
devices.
Also provide security products for AWS customers to complement their
cloud security profiles:
• UTM [ free trial available! ]
• Secure Server for Linux [ AMI available in Marketplace ]
www.sophos.com/aws
What to expect from the session
• How to schedule tasks in AWS Lambda
• Overview of the various options available
• Building up a pure Lambda scheduling infrastructure
• Resources and templates to implement this yourself
Events? Scheduling?
Why would I want to schedule Lambda?
• Lambda designed as event-driven computing
• Event-driven computing is awesome
• Most of the time you want to trigger because something
happens…
HOWEVER
Why would I want to schedule Lambda?
Sometimes you just plain need to do something on a
schedule.
Examples:
• Log cleanup
• Batching up statistics
• Alarm clock
• Infrastructure automation
Scheduling options on traditional infrastructure
Unix
• cron: recurring tasks
*/2 * * * * do_something
• at: run a task at a specific time
at 1615 oct 7 <<< “mail –s’AWS talk!’ guy.davies@sophos.com”
Windows
• Scheduled tasks
• AT
Options for scheduling Lambda functions (1)
1. Spin up an Amazon EC2 instance, and use crontab to
invoke Lambda
• Why bother running Lambda at all?
• Many folks want a pure-Lambda deployment
• Running an instance means more to manage
• Not hugely financially efficient
Options for scheduling Lambda functions (2)
2. Unreliable Town Clock (townclock.io)
• Awesome public Amazon SNS topic
• Chimes every fifteen minutes
• Community supported
• Has a 15 minute granularity
Options for scheduling Lambda functions (3)
3. Others…
• Trigger from Amazon SWF
• Trigger from an instance in AWS Data Pipeline
• Trigger from an AWS CloudTrail upload into an Amazon S3
bucket
All of these could be your solution! But what if we want a
“pure” Lambda implementation that’s managed by AWS?
A pure Lambda scheduler
How do we generate a timing signal in AWS?
0
0.2
0.4
0.6
0.8
1
Photo: ‘Signetics NE5555N, …’ by Stefan506 is
licenced by CC BY-SA 3.0. Source:
https://en.wikipedia.org/wiki/555_timer_IC
Amazon
CloudWatch
CloudWatch as a time signal
1. Set an alarm on a CloudWatch metric
2. Alarm goes into ALARM state:
• Triggers Amazon SNS which triggers Lambda
• Lambda inverts the state of the metric
3. Alarm goes into OK state:
• Triggers SNS which triggers Lambda
• Lambda inverts the state of the metric
Configuring the CloudWatch alarm
Configuring the CloudWatch alarm
Once the metric is
inverted, the alarm will
trigger at the top of the
next minute:
1-minute resolution
Configuring the CloudWatch alarm
All three states trigger the
same SNS notification. The
Lambda function figures
which was the trigger and
sets the CloudWatch
metric to the opposite state
Putting it together
Lambda
cron
function
CloudWatch
metric
CloudWatch alarm
triggers
SNS topic10
Invoke further Lambda
functions (if scheduled)
The Lambda function
Lambda function
1. The “event” is the SNS notification that is sent by
CloudWatch.
2. Invert the value of the CloudWatch metric.
3. Jobs and schedule are managed as a separate JSON
file in the bundle.
4. Invoke any Lambda functions in the schedule that are
scheduled to be run this minute.
5. Done.
Main Lambda function
exports.handler = function(event, context) {
async.waterfall([
function (callback) { flip_cloudwatch(event,callback); },
read_crontab,
execute_lambdas
], function (err) {
if (err) context.fail(err);
else context.succeed(); });
};
Flipping CloudWatch
The event is an SNS message from CloudWatch:
var snsmessage = JSON.parse(event.Records[0].Sns.Message);
If it’s just gone into alarm, we want to reset to zero. Likewise if it’s just gone into
OK, reset to 1.
if (snsmessage.NewStateValue == 'ALARM') { value = 0.0 }
else if (snsmessage.NewStateValue == 'OK' || snsmessage.NewStateValue ==
'INSUFFICIENT_DATA') { value = 1.0 };
Push the new value to CloudWatch:
var params = { MetricData: [ { MetricName: 'LambdaCron', Timestamp: new Date,
Unit: 'None', Value: value } ], Namespace: 'LambdaCron' };
cloudwatch.putMetricData(params, function(err, data) { . . . });
Crontab-like Lambda configuration
{
"jobs": [ {
"schedule": "*/3 * * * *",
"function": "testfunction",
"args": {
"key1": "test1",
"key3": "test3",
"key2": "test2"
}
} ]
}
Checking the schedule (1)
Use the fantastic cron-parser library (https://github.com/harrisiirak/cron-parser/
MIT licenced)
var parser = require('cron-parser');
Create a Date object which refers to the top of the current minute to compare
the schedule to.
var d = new Date();
d.setSeconds(0);
d.setMilliseconds(0);
Parse the crontab to find the ‘next’ runtime for the job (= now if it needs to run)
var interval =
parser.parseExpression(job["schedule"],{currentDate: d});
var runtime = interval.next();
Run each job that needs running
if (datestring == runtimestring) {
var lambda = new AWS.Lambda();
var params = {
FunctionName: job["function"],
InvocationType: "Event",
Payload: JSON.stringify(job["args"])
};
lambda.invoke(params, function(err,data) {
if (err) iteratorcallback(err);
else iteratorcallback(null);
});
}
}
Demo
Use cases
Trialling this for intelligent scaling on a schedule
• AWS scheduled scaling has limitations:
• Absolute number of desired instances
• Limit of 120 tasks per month
• Lambda function triggered by lambda-cron could do for
example:
• Every morning at 08:00 UTC, add 20% of capacity unless we
have > 30 instances already running
Reliability and monitoring
Empirically pretty reliable.
Running since April without (much!) intervention.
Even comes back after outages!
Reliability and monitoring
Monitoring: CloudWatch!
• Lambda invocation metrics will tell you that it’s running
• Application-level monitoring on the jobs you are
triggering
60 invocations / hr
Summary
1. Use CloudWatch alarms as two states to provide a
timing signal to Lambda.
2. Trigger off all three states to enhance reliability.
3. Allows us to schedule tasks purely within Lambda.
4. The cron function invokes once a minute.
Resources
Github:
github.com/g-a-d/lambda-cron
Email:
guy.davies@sophos.com
AWS
CloudFormation
stack
Lambda
function
Resources
Libraries used:
• async: https://github.com/caolan/async
• avoid nested-callback-hell (great for folks more used to
procedural programming)
• MIT license
• cron-parser: https://github.com/harrisiirak/cron-parser
• parse crontabs
• MIT license
Resources
Remember to check www.sophos.com/aws
• UTM for AWS (free trial available)
• Secure server for AWS
• Free trials, free home use AV
Remember to complete
your evaluations!
Thank you!

More Related Content

What's hot

Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon Web Services Korea
 
Introduction to Amazon Web Services by i2k2 Networks
Introduction to Amazon Web Services by i2k2 NetworksIntroduction to Amazon Web Services by i2k2 Networks
Introduction to Amazon Web Services by i2k2 Networksi2k2 Networks (P) Ltd.
 
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인Amazon Web Services Korea
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesGary Silverman
 
Introduction to AWS Cloud Computing
Introduction to AWS Cloud ComputingIntroduction to AWS Cloud Computing
Introduction to AWS Cloud ComputingAmazon Web Services
 
Aberdeen Oil & Gas Event - Introduction to the AWS Cloud
Aberdeen Oil & Gas Event - Introduction to the AWS CloudAberdeen Oil & Gas Event - Introduction to the AWS Cloud
Aberdeen Oil & Gas Event - Introduction to the AWS CloudAmazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIsAmazon Web Services
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Amazon Web Services
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAmazon Web Services
 
ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례Anson Park
 
Cloud Computing and Amazon Web Services
Cloud Computing and Amazon Web ServicesCloud Computing and Amazon Web Services
Cloud Computing and Amazon Web ServicesAditya Jha
 
Virtualization for Cloud Environment
Virtualization for Cloud EnvironmentVirtualization for Cloud Environment
Virtualization for Cloud EnvironmentDr. Sunil Kr. Pandey
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceAmazon Web Services
 

What's hot (20)

Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
AWS SQS SNS
AWS SQS SNSAWS SQS SNS
AWS SQS SNS
 
Introduction to Amazon Web Services by i2k2 Networks
Introduction to Amazon Web Services by i2k2 NetworksIntroduction to Amazon Web Services by i2k2 Networks
Introduction to Amazon Web Services by i2k2 Networks
 
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best Practices
 
Introduction to AWS Cloud Computing
Introduction to AWS Cloud ComputingIntroduction to AWS Cloud Computing
Introduction to AWS Cloud Computing
 
Aberdeen Oil & Gas Event - Introduction to the AWS Cloud
Aberdeen Oil & Gas Event - Introduction to the AWS CloudAberdeen Oil & Gas Event - Introduction to the AWS Cloud
Aberdeen Oil & Gas Event - Introduction to the AWS Cloud
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
AWS RDS
AWS RDSAWS RDS
AWS RDS
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWS
 
ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례ELB를 활용한 Socket.IO 멀티노드 구축사례
ELB를 활용한 Socket.IO 멀티노드 구축사례
 
Cloud Computing and Amazon Web Services
Cloud Computing and Amazon Web ServicesCloud Computing and Amazon Web Services
Cloud Computing and Amazon Web Services
 
Virtualization for Cloud Environment
Virtualization for Cloud EnvironmentVirtualization for Cloud Environment
Virtualization for Cloud Environment
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
AWS CodeDeploy Getting Started
AWS CodeDeploy Getting StartedAWS CodeDeploy Getting Started
AWS CodeDeploy Getting Started
 

Viewers also liked

AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...Amazon Web Services
 
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...Amazon Web Services
 
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...ServerlessConf
 
Ben Kehoe - Serverless Architecture for the Internet of Things
Ben Kehoe - Serverless Architecture for the Internet of ThingsBen Kehoe - Serverless Architecture for the Internet of Things
Ben Kehoe - Serverless Architecture for the Internet of ThingsServerlessConf
 
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)Amazon Web Services
 
Real-time Data Processing with Amazon DynamoDB Streams and AWS Lambda
Real-time Data Processing with Amazon DynamoDB Streams and AWS LambdaReal-time Data Processing with Amazon DynamoDB Streams and AWS Lambda
Real-time Data Processing with Amazon DynamoDB Streams and AWS LambdaAmazon Web Services
 
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Josef A. Habdank
 
Amazon Aurora: The New Relational Database Engine from Amazon
Amazon Aurora: The New Relational Database Engine from AmazonAmazon Aurora: The New Relational Database Engine from Amazon
Amazon Aurora: The New Relational Database Engine from AmazonAmazon Web Services
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivAmazon Web Services
 
Deep Dive: Amazon Elastic MapReduce
Deep Dive: Amazon Elastic MapReduceDeep Dive: Amazon Elastic MapReduce
Deep Dive: Amazon Elastic MapReduceAmazon Web Services
 
OAuth 2.0 refresher Talk
OAuth 2.0 refresher TalkOAuth 2.0 refresher Talk
OAuth 2.0 refresher Talkmarcwan
 
Beyond Shuffling - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...
Beyond Shuffling  - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...Beyond Shuffling  - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...
Beyond Shuffling - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...Holden Karau
 
Building a Serverless Pipeline
Building a Serverless PipelineBuilding a Serverless Pipeline
Building a Serverless PipelineJulien SIMON
 
Architecting for Greater Security on AWS
Architecting for Greater Security on AWSArchitecting for Greater Security on AWS
Architecting for Greater Security on AWSAmazon Web Services
 
Release the Monkeys ! Testing in the Wild at Netflix
Release the Monkeys !  Testing in the Wild at NetflixRelease the Monkeys !  Testing in the Wild at Netflix
Release the Monkeys ! Testing in the Wild at NetflixGareth Bowles
 
Py.test
Py.testPy.test
Py.testsoasme
 

Viewers also liked (20)

AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
 
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...
AWS re:Invent 2016: Using AWS Lambda to Build Control Systems for Your AWS In...
 
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...
Frederic Lavigne and Stephen Fink - Serverless Video Processing with IBM Blue...
 
Ben Kehoe - Serverless Architecture for the Internet of Things
Ben Kehoe - Serverless Architecture for the Internet of ThingsBen Kehoe - Serverless Architecture for the Internet of Things
Ben Kehoe - Serverless Architecture for the Internet of Things
 
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
 
Real-time Data Processing with Amazon DynamoDB Streams and AWS Lambda
Real-time Data Processing with Amazon DynamoDB Streams and AWS LambdaReal-time Data Processing with Amazon DynamoDB Streams and AWS Lambda
Real-time Data Processing with Amazon DynamoDB Streams and AWS Lambda
 
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
 
AWS Lambda Updates
AWS Lambda UpdatesAWS Lambda Updates
AWS Lambda Updates
 
Amazon Aurora: The New Relational Database Engine from Amazon
Amazon Aurora: The New Relational Database Engine from AmazonAmazon Aurora: The New Relational Database Engine from Amazon
Amazon Aurora: The New Relational Database Engine from Amazon
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
Deep Dive: Amazon Elastic MapReduce
Deep Dive: Amazon Elastic MapReduceDeep Dive: Amazon Elastic MapReduce
Deep Dive: Amazon Elastic MapReduce
 
El uso de la c
El uso de la cEl uso de la c
El uso de la c
 
OAuth 2.0 refresher Talk
OAuth 2.0 refresher TalkOAuth 2.0 refresher Talk
OAuth 2.0 refresher Talk
 
EC2 Avanzado
EC2 AvanzadoEC2 Avanzado
EC2 Avanzado
 
Beyond Shuffling - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...
Beyond Shuffling  - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...Beyond Shuffling  - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...
Beyond Shuffling - Effective Tips and Tricks for Scaling Spark (Vancouver Sp...
 
Building a Serverless Pipeline
Building a Serverless PipelineBuilding a Serverless Pipeline
Building a Serverless Pipeline
 
Architecting for Greater Security on AWS
Architecting for Greater Security on AWSArchitecting for Greater Security on AWS
Architecting for Greater Security on AWS
 
Release the Monkeys ! Testing in the Wild at Netflix
Release the Monkeys !  Testing in the Wild at NetflixRelease the Monkeys !  Testing in the Wild at Netflix
Release the Monkeys ! Testing in the Wild at Netflix
 
Py.test
Py.testPy.test
Py.test
 
Survival Analysis of Web Users
Survival Analysis of Web UsersSurvival Analysis of Web Users
Survival Analysis of Web Users
 

Similar to (CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda

Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...Amazon Web Services
 
SoCal NodeJS Meetup 20170215_aws_lambda
SoCal NodeJS Meetup 20170215_aws_lambdaSoCal NodeJS Meetup 20170215_aws_lambda
SoCal NodeJS Meetup 20170215_aws_lambdaStefan Deusch
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkAtlogys Technical Consulting
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaAmazon Web Services
 
A Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaA Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaAmazon Web Services
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaAmazon Web Services
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureMikhail Prudnikov
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAmazon Web Services
 
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless CloudAWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...Amazon Web Services
 
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...Amazon Web Services
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudIan Massingham
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Apigee | Google Cloud
 
(CMP403) AWS Lambda: Simplifying Big Data Workloads
(CMP403) AWS Lambda: Simplifying Big Data Workloads(CMP403) AWS Lambda: Simplifying Big Data Workloads
(CMP403) AWS Lambda: Simplifying Big Data WorkloadsAmazon Web Services
 
Introduction to AWS Lambda with Python
Introduction to AWS Lambda with PythonIntroduction to AWS Lambda with Python
Introduction to AWS Lambda with Pythonadaplo
 

Similar to (CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda (20)

Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
SoCal NodeJS Meetup 20170215_aws_lambda
SoCal NodeJS Meetup 20170215_aws_lambdaSoCal NodeJS Meetup 20170215_aws_lambda
SoCal NodeJS Meetup 20170215_aws_lambda
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
 
Real-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS LambdaReal-time Data Processing Using AWS Lambda
Real-time Data Processing Using AWS Lambda
 
A Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaA Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS Lambda
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless Cloud
 
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless CloudAWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
 
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
 
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...
Monitoring, Hold the Infrastructure - Getting the Most out of AWS Lambda – Da...
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda
 
(CMP403) AWS Lambda: Simplifying Big Data Workloads
(CMP403) AWS Lambda: Simplifying Big Data Workloads(CMP403) AWS Lambda: Simplifying Big Data Workloads
(CMP403) AWS Lambda: Simplifying Big Data Workloads
 
Intro to AWS Lambda
Intro to AWS LambdaIntro to AWS Lambda
Intro to AWS Lambda
 
Introduction to AWS Lambda with Python
Introduction to AWS Lambda with PythonIntroduction to AWS Lambda with Python
Introduction to AWS Lambda with Python
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

(CMP407) Lambda as Cron: Scheduling Invocations in AWS Lambda

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Guy Davies, Sophos Ltd. October 2015 CMP407 Lambda as Cron Scheduling Invocations in AWS Lambda
  • 2. About me • Guy Davies, Senior Systems Engineer, Sophos Ltd Sophos use AWS extensively in our operations to support our anti- malware, anti-spam, and threat-detection software and hardware devices. Also provide security products for AWS customers to complement their cloud security profiles: • UTM [ free trial available! ] • Secure Server for Linux [ AMI available in Marketplace ] www.sophos.com/aws
  • 3. What to expect from the session • How to schedule tasks in AWS Lambda • Overview of the various options available • Building up a pure Lambda scheduling infrastructure • Resources and templates to implement this yourself
  • 5. Why would I want to schedule Lambda? • Lambda designed as event-driven computing • Event-driven computing is awesome • Most of the time you want to trigger because something happens… HOWEVER
  • 6. Why would I want to schedule Lambda? Sometimes you just plain need to do something on a schedule. Examples: • Log cleanup • Batching up statistics • Alarm clock • Infrastructure automation
  • 7. Scheduling options on traditional infrastructure Unix • cron: recurring tasks */2 * * * * do_something • at: run a task at a specific time at 1615 oct 7 <<< “mail –s’AWS talk!’ guy.davies@sophos.com” Windows • Scheduled tasks • AT
  • 8. Options for scheduling Lambda functions (1) 1. Spin up an Amazon EC2 instance, and use crontab to invoke Lambda • Why bother running Lambda at all? • Many folks want a pure-Lambda deployment • Running an instance means more to manage • Not hugely financially efficient
  • 9. Options for scheduling Lambda functions (2) 2. Unreliable Town Clock (townclock.io) • Awesome public Amazon SNS topic • Chimes every fifteen minutes • Community supported • Has a 15 minute granularity
  • 10. Options for scheduling Lambda functions (3) 3. Others… • Trigger from Amazon SWF • Trigger from an instance in AWS Data Pipeline • Trigger from an AWS CloudTrail upload into an Amazon S3 bucket All of these could be your solution! But what if we want a “pure” Lambda implementation that’s managed by AWS?
  • 11. A pure Lambda scheduler
  • 12. How do we generate a timing signal in AWS? 0 0.2 0.4 0.6 0.8 1 Photo: ‘Signetics NE5555N, …’ by Stefan506 is licenced by CC BY-SA 3.0. Source: https://en.wikipedia.org/wiki/555_timer_IC Amazon CloudWatch
  • 13. CloudWatch as a time signal 1. Set an alarm on a CloudWatch metric 2. Alarm goes into ALARM state: • Triggers Amazon SNS which triggers Lambda • Lambda inverts the state of the metric 3. Alarm goes into OK state: • Triggers SNS which triggers Lambda • Lambda inverts the state of the metric
  • 15. Configuring the CloudWatch alarm Once the metric is inverted, the alarm will trigger at the top of the next minute: 1-minute resolution
  • 16. Configuring the CloudWatch alarm All three states trigger the same SNS notification. The Lambda function figures which was the trigger and sets the CloudWatch metric to the opposite state
  • 17. Putting it together Lambda cron function CloudWatch metric CloudWatch alarm triggers SNS topic10 Invoke further Lambda functions (if scheduled)
  • 19. Lambda function 1. The “event” is the SNS notification that is sent by CloudWatch. 2. Invert the value of the CloudWatch metric. 3. Jobs and schedule are managed as a separate JSON file in the bundle. 4. Invoke any Lambda functions in the schedule that are scheduled to be run this minute. 5. Done.
  • 20. Main Lambda function exports.handler = function(event, context) { async.waterfall([ function (callback) { flip_cloudwatch(event,callback); }, read_crontab, execute_lambdas ], function (err) { if (err) context.fail(err); else context.succeed(); }); };
  • 21. Flipping CloudWatch The event is an SNS message from CloudWatch: var snsmessage = JSON.parse(event.Records[0].Sns.Message); If it’s just gone into alarm, we want to reset to zero. Likewise if it’s just gone into OK, reset to 1. if (snsmessage.NewStateValue == 'ALARM') { value = 0.0 } else if (snsmessage.NewStateValue == 'OK' || snsmessage.NewStateValue == 'INSUFFICIENT_DATA') { value = 1.0 }; Push the new value to CloudWatch: var params = { MetricData: [ { MetricName: 'LambdaCron', Timestamp: new Date, Unit: 'None', Value: value } ], Namespace: 'LambdaCron' }; cloudwatch.putMetricData(params, function(err, data) { . . . });
  • 22. Crontab-like Lambda configuration { "jobs": [ { "schedule": "*/3 * * * *", "function": "testfunction", "args": { "key1": "test1", "key3": "test3", "key2": "test2" } } ] }
  • 23. Checking the schedule (1) Use the fantastic cron-parser library (https://github.com/harrisiirak/cron-parser/ MIT licenced) var parser = require('cron-parser'); Create a Date object which refers to the top of the current minute to compare the schedule to. var d = new Date(); d.setSeconds(0); d.setMilliseconds(0); Parse the crontab to find the ‘next’ runtime for the job (= now if it needs to run) var interval = parser.parseExpression(job["schedule"],{currentDate: d}); var runtime = interval.next();
  • 24. Run each job that needs running if (datestring == runtimestring) { var lambda = new AWS.Lambda(); var params = { FunctionName: job["function"], InvocationType: "Event", Payload: JSON.stringify(job["args"]) }; lambda.invoke(params, function(err,data) { if (err) iteratorcallback(err); else iteratorcallback(null); }); } }
  • 25. Demo
  • 26. Use cases Trialling this for intelligent scaling on a schedule • AWS scheduled scaling has limitations: • Absolute number of desired instances • Limit of 120 tasks per month • Lambda function triggered by lambda-cron could do for example: • Every morning at 08:00 UTC, add 20% of capacity unless we have > 30 instances already running
  • 27. Reliability and monitoring Empirically pretty reliable. Running since April without (much!) intervention. Even comes back after outages!
  • 28. Reliability and monitoring Monitoring: CloudWatch! • Lambda invocation metrics will tell you that it’s running • Application-level monitoring on the jobs you are triggering 60 invocations / hr
  • 29. Summary 1. Use CloudWatch alarms as two states to provide a timing signal to Lambda. 2. Trigger off all three states to enhance reliability. 3. Allows us to schedule tasks purely within Lambda. 4. The cron function invokes once a minute.
  • 31. Resources Libraries used: • async: https://github.com/caolan/async • avoid nested-callback-hell (great for folks more used to procedural programming) • MIT license • cron-parser: https://github.com/harrisiirak/cron-parser • parse crontabs • MIT license
  • 32. Resources Remember to check www.sophos.com/aws • UTM for AWS (free trial available) • Secure server for AWS • Free trials, free home use AV