SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Perl and Amazon Web
Services
London Perl Workshop 2019
1
Introduction
In this talk I will
● give a very short introduction to cloud computing in general
● introduce a few AWS resources (CloudFormation, EC2, S3, Lambda)
● demonstrate running Perl on an EC2 instance
● demonstrate using AWS::Lambda to create a Perl runtime for AWS Lambda
2
But, first
About me:
● My name is Søren Lund and I’m from Denmark
● I’ve been a SW developer for more than twenty years
● I’ve used many programming languages (C/C++, Perl, Java, JavaScript, …)
● I’ve also worked a lot with build automation, CI/CD and automated tests
● I’ve worked as a AWS consultant for the last couple of years
3
Disclaimer
● I’ve no experience running Perl on AWS!
However,
● I know Perl
● I know AWS
Or, as the meme goes
● “Trust Me, I’m an Engineer”
4
Cloud Computing
5
Cloud Computing
“Cloud computing is the on-demand availability of computer system
resources, especially data storage and computing power, without direct active
management by the user.”
“Cloud computing was popularized with Amazon.com releasing its Elastic
Compute Cloud product in 2006.”
From https://en.wikipedia.org/wiki/Cloud_computing
6
Service Models
● Infrastructure as a service (IaaS)
● Platform as a service (PaaS)
● Software as a service (SaaS)
● Serverless computing
● Function as a service (FaaS)
7
Infrastructure as a service (IaaS)
“...online services that provide high-level APIs used to dereference various low-
level details of underlying network infrastructure like physical computing
resources, location, data partitioning, scaling, security, backup etc.”
From https://en.wikipedia.org/wiki/Infrastructure_as_a_service
8
Function as a service (FaaS)
“...category of cloud computing services that provides a platform allowing
customers to develop, run, and manage application functionalities without the
complexity of building and maintaining the infrastructure typically associated with
developing and launching an app.”
From https://en.wikipedia.org/wiki/Function_as_a_service
9
Amazon Web Services
10
Amazon Web Service (AWS)
● From 2000 to 2005 Amazon.com works on infrastructure
● AWS is launched on March 19 2006, first service is Amazon S3 (Simple
Storage Service)
● Amazon SQS (Simple Queue Service) follows on July 13
● And on August 25 Amazon EC2 (Elastic Compute Cloud) is launched
From https://en.wikipedia.org/wiki/Timeline_of_Amazon_Web_Services
11
AWS now has many more services
“...137 top level services spread across 23 categories… many of these top level
services further expand into multiple sub services” (January 2019)
From https://www.quora.com/How-many-AWS-services-are-there
See https://aws.amazon.com/products/
12
Getting started with AWS
Sign up at https://aws.amazon.com/
Free tier: https://aws.amazon.com/free/
● Always free - e.g. 1 million free requests on AWS Lambda every month
● 12 month free - e.g. 750 hours EC2 t2.micro instance usage every month
● Trials - e.g. 250 device minutes on AWS Device Farm
13
AWS Management Console
From the “Console” you can create/modify/maintain/destroy resources.
See https://console.aws.amazon.com/console/home
14
Launching an EC2 instance from the Console
15
AWS CLI
The AWS CLI is a uber command “aws”, that can be used to manage your AWS
resources and services.
● Written in Python (pip install awscli)
● Enables you to write scripts that creates/modifies/maintains/destroys
resources
● You need to create credentials (tokens) in the Console to use the CLI
See https://aws.amazon.com/cli/
16
AWS SDKs
Official SDKs providing APIs for AWS services are available in
● JavaScript
● Python
● PHP
● .NET
● Ruby
● Java
● Go
● Node.js
● C++
See https://aws.amazon.com/tools/
Image by Jonny
Lindner from Pixabay
?
17
Paws
● Perl SDK for AWS
● Built by automatically converting Python code into Perl code
● Also includes CLI (paws)
● https://metacpan.org/pod/Paws
18
Image by Jonny
Lindner from Pixabay
❤
AWS CloudFormation
● Infrastructure as code
● Define resources in templates (JSON or YAML) or visual designer
● Deploy template using CloudFormation using the Consol, CLI or API
● A deployed template is called a Stack
19
Basic Anatomy of a CloudFormation Template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "",
"Parameters" : { },
"Resources" : { },
"Outputs" : { }
}
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
20
Running Perl on an EC2 instance
21
Creating a CloudFormation Templates
AWS has lots of examples and snippets.
● Examples: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html
● Snippets: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/CHAP_TemplateQuickRef.html
There’s also a linter for CloudFormation Templates:
● See https://github.com/aws-cloudformation/cfn-python-lint
22
Amazon EC2
● EC2 provides generic computer virtualization
● When using EC2 you will boot an Amazon Machine Image (AMI) to create a
running machine, called an instance
● Amazon maintains an AMI called Amazon Linux based on CentOS
○ version 1 has Perl 5.16.3
○ version 2 has no Perl
● Run it locally: docker run -it amazonlinux bash
23
User Data in EC2 CloudFormation templates
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"", [
"#!/bin/bashn",
"curl -L http://cpanmin.us | perl - --self-upgraden",
"cpanm Acme::Be::Modernn"
]]
}
}
24
Demo time
Code is available on GitHub.
See https://github.com/soren/perl-and-aws
25
AWS::Lambda
26
AWS Lambda
“...an event-driven, serverless computing platform provided by Amazon as a part
of the Amazon Web Services. It is a computing service that runs code in response
to events and automatically manages the computing resources required by that
code. It was introduced in November 2014.”
From https://en.wikipedia.org/wiki/AWS_Lambda
27
Console demo
28
Using the AWS Lambda runtime provided by
● https://metacpan.org/pod/AWS::Lambda
To execute the following:
sub handle {
my ($payload, $context) = @_;
my $result = encode_json("Hello from Perl!");
return +{ statusCode => 200, body => $result };
}
The End… Questions?
29

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Amazon ECS (March 2016)
Amazon ECS (March 2016)Amazon ECS (March 2016)
Amazon ECS (March 2016)
 
Docker Paris #29
Docker Paris #29Docker Paris #29
Docker Paris #29
 
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...Scaling your web app  horizontally and vertically (ahmedabad amazon aws cloud...
Scaling your web app horizontally and vertically (ahmedabad amazon aws cloud...
 
AWS CodeDeploy - basic intro
AWS CodeDeploy - basic introAWS CodeDeploy - basic intro
AWS CodeDeploy - basic intro
 
Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015Meeyup aws-loadbalancing-28032015
Meeyup aws-loadbalancing-28032015
 
Building serverless apps with Node.js
Building serverless apps with Node.jsBuilding serverless apps with Node.js
Building serverless apps with Node.js
 
Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015Building A Dynamic Website - 31st Jan 2015
Building A Dynamic Website - 31st Jan 2015
 
How to copy multiple files from local to aws s3 bucket using aws cli
How to copy multiple files from local to aws s3 bucket using aws cliHow to copy multiple files from local to aws s3 bucket using aws cli
How to copy multiple files from local to aws s3 bucket using aws cli
 
Aws meetup building_lambda
Aws meetup building_lambdaAws meetup building_lambda
Aws meetup building_lambda
 
Deploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic BeanstalkDeploying a simple Rails application with AWS Elastic Beanstalk
Deploying a simple Rails application with AWS Elastic Beanstalk
 
Project final pres
Project final presProject final pres
Project final pres
 
20190406 LT(笹亀)
20190406 LT(笹亀)20190406 LT(笹亀)
20190406 LT(笹亀)
 
Continuous delivery in AWS
Continuous delivery in AWSContinuous delivery in AWS
Continuous delivery in AWS
 
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalk
 
Cloud Academy's AWS Hands on-labs
Cloud Academy's AWS Hands on-labsCloud Academy's AWS Hands on-labs
Cloud Academy's AWS Hands on-labs
 
What is AWS lambda?
What is AWS lambda?What is AWS lambda?
What is AWS lambda?
 
Intro to batch processing on AWS
Intro to batch processing on AWSIntro to batch processing on AWS
Intro to batch processing on AWS
 
Introduction to Batch Processing on AWS
Introduction to Batch Processing on AWSIntroduction to Batch Processing on AWS
Introduction to Batch Processing on AWS
 
Introduction to the Serverless paradigm
Introduction to the Serverless paradigmIntroduction to the Serverless paradigm
Introduction to the Serverless paradigm
 
Introduction to aws cloud formation
Introduction to aws cloud formationIntroduction to aws cloud formation
Introduction to aws cloud formation
 

Ähnlich wie Perl and Amazon Web Services

Ähnlich wie Perl and Amazon Web Services (20)

A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
 
Managing AWS infrastructure using CloudFormation
Managing AWS infrastructure using CloudFormationManaging AWS infrastructure using CloudFormation
Managing AWS infrastructure using CloudFormation
 
Aws training banglore 13
Aws training banglore 13Aws training banglore 13
Aws training banglore 13
 
Aws training banglore 2
Aws training banglore 2Aws training banglore 2
Aws training banglore 2
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWS
 
Aws training banglore 8
Aws training banglore 8Aws training banglore 8
Aws training banglore 8
 
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky..."Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
 
AWS and Serverless Computing
AWS and Serverless ComputingAWS and Serverless Computing
AWS and Serverless Computing
 
Aws training banglore 1
Aws training banglore 1Aws training banglore 1
Aws training banglore 1
 
Aws training banglore 5
Aws training banglore 5Aws training banglore 5
Aws training banglore 5
 
Aws training banglore 15
Aws training banglore 15Aws training banglore 15
Aws training banglore 15
 
AWS architect certification course
AWS architect certification course AWS architect certification course
AWS architect certification course
 
Aws training banglore 6
Aws training banglore 6Aws training banglore 6
Aws training banglore 6
 
Back-end (Flask_AWS)
Back-end (Flask_AWS)Back-end (Flask_AWS)
Back-end (Flask_AWS)
 
Aws training banglore 11
Aws training banglore 11Aws training banglore 11
Aws training banglore 11
 
Aws training banglore 10
Aws training banglore 10Aws training banglore 10
Aws training banglore 10
 
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastrutturaArchitetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
Architetture Serverless: concentrarsi sull'idea, non sull'infrastruttura
 
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
Serverless Optical Character Recognition in support of Astronaut Safety AWS M...
 
Aws training banglore 12
Aws training banglore 12Aws training banglore 12
Aws training banglore 12
 
Aws training banglore 7
Aws training banglore 7Aws training banglore 7
Aws training banglore 7
 

Mehr von Søren Lund

Mehr von Søren Lund (8)

Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Playing with Hadoop (NPW2013)
Playing with Hadoop (NPW2013)Playing with Hadoop (NPW2013)
Playing with Hadoop (NPW2013)
 
Playing with Hadoop 2013-10-31
Playing with Hadoop 2013-10-31Playing with Hadoop 2013-10-31
Playing with Hadoop 2013-10-31
 
Apache JMeter Introduction
Apache JMeter IntroductionApache JMeter Introduction
Apache JMeter Introduction
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
 
E-books and App::Pod2Epub
E-books and App::Pod2EpubE-books and App::Pod2Epub
E-books and App::Pod2Epub
 

Kürzlich hochgeladen

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Kürzlich hochgeladen (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Perl and Amazon Web Services

  • 1. Perl and Amazon Web Services London Perl Workshop 2019 1
  • 2. Introduction In this talk I will ● give a very short introduction to cloud computing in general ● introduce a few AWS resources (CloudFormation, EC2, S3, Lambda) ● demonstrate running Perl on an EC2 instance ● demonstrate using AWS::Lambda to create a Perl runtime for AWS Lambda 2
  • 3. But, first About me: ● My name is Søren Lund and I’m from Denmark ● I’ve been a SW developer for more than twenty years ● I’ve used many programming languages (C/C++, Perl, Java, JavaScript, …) ● I’ve also worked a lot with build automation, CI/CD and automated tests ● I’ve worked as a AWS consultant for the last couple of years 3
  • 4. Disclaimer ● I’ve no experience running Perl on AWS! However, ● I know Perl ● I know AWS Or, as the meme goes ● “Trust Me, I’m an Engineer” 4
  • 6. Cloud Computing “Cloud computing is the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user.” “Cloud computing was popularized with Amazon.com releasing its Elastic Compute Cloud product in 2006.” From https://en.wikipedia.org/wiki/Cloud_computing 6
  • 7. Service Models ● Infrastructure as a service (IaaS) ● Platform as a service (PaaS) ● Software as a service (SaaS) ● Serverless computing ● Function as a service (FaaS) 7
  • 8. Infrastructure as a service (IaaS) “...online services that provide high-level APIs used to dereference various low- level details of underlying network infrastructure like physical computing resources, location, data partitioning, scaling, security, backup etc.” From https://en.wikipedia.org/wiki/Infrastructure_as_a_service 8
  • 9. Function as a service (FaaS) “...category of cloud computing services that provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure typically associated with developing and launching an app.” From https://en.wikipedia.org/wiki/Function_as_a_service 9
  • 11. Amazon Web Service (AWS) ● From 2000 to 2005 Amazon.com works on infrastructure ● AWS is launched on March 19 2006, first service is Amazon S3 (Simple Storage Service) ● Amazon SQS (Simple Queue Service) follows on July 13 ● And on August 25 Amazon EC2 (Elastic Compute Cloud) is launched From https://en.wikipedia.org/wiki/Timeline_of_Amazon_Web_Services 11
  • 12. AWS now has many more services “...137 top level services spread across 23 categories… many of these top level services further expand into multiple sub services” (January 2019) From https://www.quora.com/How-many-AWS-services-are-there See https://aws.amazon.com/products/ 12
  • 13. Getting started with AWS Sign up at https://aws.amazon.com/ Free tier: https://aws.amazon.com/free/ ● Always free - e.g. 1 million free requests on AWS Lambda every month ● 12 month free - e.g. 750 hours EC2 t2.micro instance usage every month ● Trials - e.g. 250 device minutes on AWS Device Farm 13
  • 14. AWS Management Console From the “Console” you can create/modify/maintain/destroy resources. See https://console.aws.amazon.com/console/home 14
  • 15. Launching an EC2 instance from the Console 15
  • 16. AWS CLI The AWS CLI is a uber command “aws”, that can be used to manage your AWS resources and services. ● Written in Python (pip install awscli) ● Enables you to write scripts that creates/modifies/maintains/destroys resources ● You need to create credentials (tokens) in the Console to use the CLI See https://aws.amazon.com/cli/ 16
  • 17. AWS SDKs Official SDKs providing APIs for AWS services are available in ● JavaScript ● Python ● PHP ● .NET ● Ruby ● Java ● Go ● Node.js ● C++ See https://aws.amazon.com/tools/ Image by Jonny Lindner from Pixabay ? 17
  • 18. Paws ● Perl SDK for AWS ● Built by automatically converting Python code into Perl code ● Also includes CLI (paws) ● https://metacpan.org/pod/Paws 18 Image by Jonny Lindner from Pixabay ❤
  • 19. AWS CloudFormation ● Infrastructure as code ● Define resources in templates (JSON or YAML) or visual designer ● Deploy template using CloudFormation using the Consol, CLI or API ● A deployed template is called a Stack 19
  • 20. Basic Anatomy of a CloudFormation Template { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "", "Parameters" : { }, "Resources" : { }, "Outputs" : { } } See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html 20
  • 21. Running Perl on an EC2 instance 21
  • 22. Creating a CloudFormation Templates AWS has lots of examples and snippets. ● Examples: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html ● Snippets: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/CHAP_TemplateQuickRef.html There’s also a linter for CloudFormation Templates: ● See https://github.com/aws-cloudformation/cfn-python-lint 22
  • 23. Amazon EC2 ● EC2 provides generic computer virtualization ● When using EC2 you will boot an Amazon Machine Image (AMI) to create a running machine, called an instance ● Amazon maintains an AMI called Amazon Linux based on CentOS ○ version 1 has Perl 5.16.3 ○ version 2 has no Perl ● Run it locally: docker run -it amazonlinux bash 23
  • 24. User Data in EC2 CloudFormation templates "UserData": { "Fn::Base64": { "Fn::Join": [ "", [ "#!/bin/bashn", "curl -L http://cpanmin.us | perl - --self-upgraden", "cpanm Acme::Be::Modernn" ]] } } 24
  • 25. Demo time Code is available on GitHub. See https://github.com/soren/perl-and-aws 25
  • 27. AWS Lambda “...an event-driven, serverless computing platform provided by Amazon as a part of the Amazon Web Services. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code. It was introduced in November 2014.” From https://en.wikipedia.org/wiki/AWS_Lambda 27
  • 28. Console demo 28 Using the AWS Lambda runtime provided by ● https://metacpan.org/pod/AWS::Lambda To execute the following: sub handle { my ($payload, $context) = @_; my $result = encode_json("Hello from Perl!"); return +{ statusCode => 200, body => $result }; }