Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Perl and Amazon Web Services

199 views

Published on

Amazon Web Services (AWS) is the world’s biggest cloud provider, pioneering the implementation of cloud services like infrastructure-as-a-service (IaaS) and function-as-a-Service (FaaS). But how does Perl fit into the world of AWS?

IaaS is the provisioning of virtualized computing resources. In the case of AWS, the most fundamental IaaS resource is the Amazon Elastic Compute Cloud (EC2), it 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 2, it does not have Perl installed, however installing Perl is straightforward. You can even create your own AMI with a pre-installed Perl.

FaaS is the provisioning of a well-defined execution environment, where you can run and manage application functionality, without having to think about infrastructure. The AWS FaaS offering is called AWS Lambda. AWS Lambda natively supports code written in Java, Go, PowerShell, Node.js, C#, Python, and Ruby. However, it also provides an HTTP API for custom runtimes, making it possible to write AWS Lambdas in any programming language, including Perl, if you define a corresponding runtime.

In this talk I will

* give a very short introduction to cloud 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

This talk is a quick introduction to AWS for Perl developers. Attendees need no previous experience with AWS; however, a basic knowledge Perl will be expected.

Published in: Software
  • I like this service ⇒ www.HelpWriting.net ⇐ from Academic Writers. I don't have enough time write it by myself.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I like this service ⇒ www.WritePaper.info ⇐ from Academic Writers. I don't have enough time write it by myself.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ●●● https://t.cn/A6ybKmr1
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Perl and Amazon Web Services

  1. 1. Perl and Amazon Web Services London Perl Workshop 2019 1
  2. 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. 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. 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
  5. 5. Cloud Computing 5
  6. 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. 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. 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. 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
  10. 10. Amazon Web Services 10
  11. 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. 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. 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. 14. AWS Management Console From the “Console” you can create/modify/maintain/destroy resources. See https://console.aws.amazon.com/console/home 14
  15. 15. Launching an EC2 instance from the Console 15
  16. 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. 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. 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. 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. 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. 21. Running Perl on an EC2 instance 21
  22. 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. 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. 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. 25. Demo time Code is available on GitHub. See https://github.com/soren/perl-and-aws 25
  26. 26. AWS::Lambda 26
  27. 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. 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 }; }
  29. 29. The End… Questions? 29

×