SlideShare a Scribd company logo
1 of 47
Building an AWS
SDK
Granada Perl Workshop 2014
Jose Luis Martinez
JLMARTIN on CPAN
Twitter: @pplu_io
joseluis.martinez@capside.com
About me
 CTO @CAPSiDE
 Training Partner for AWS
 Delivering AWS official training
 All four AWS certifications
 Real experience with real platforms
 Deliver consulting and continuous operation
 Writing Perl for +10 years
 And still having fun with it!
About AWS
 Mostly known for EC2 and S3
 But lot's more services! (+30)
 Everything is an API
 “Programmable datacenter”
 Software Defined Everything
About AWS
 Mostly known for EC2 and S3
 But lot's more services! (+30)
 Everything is an API
 “Programmable datacenter”
 Software Defined Everything
It’s the your wet dream
Perl & AWS
Bad news

 No official SDK
 Official ones: Ruby, PHP,
Python, JS, .Net, Java
 Note: python wasn't
official initially!
Perl & AWS
Good news

 CPAN
 And an active
community
 Lots of modules for
different services
(sometimes more than
one)
Perl & AWS: The CPAN
 Inconsistencies
 In method naming
 Arbitrary defaults ('eu-west-1', 'us-east-1')
 Not up to date with latest APIs
 Keeping up with AWS is hard!!!
 “Not so popular” services not covered
 IAM, CloudFormation, SWF, RedShift, CloudSearch, etc
 Almost no Role support
 AWS::CLIWrapper is a good generic solution. Not native
So lets write an
entire SDK!
Hard enough
You can end up with…
or
Challenges: # of services
 30+ services
 Some with 100+ API calls
 Each call with it’s parameters
 Want to return objects
 Evolution
Challenges: # of services
So lets start classifying
Challenges: Endpoints
Endpoint Type Services
Regional Services available
in a región
the rest
Single Global services 6
Challenges: WebService Types
One URL REST
Params: Query
Response: XML
17 3
Params: JSON
Response: JSON
10 1
Challenges: Signatures
Type Services
v2 2
v3https 1
cloudfront 1
v4 the rest
Challenges: API versions
 More tan one API version is live
 That’s why not-up-to-date callers still work
 RDS
 4 versions
 CloudFront
 3 versions
 EC2
 4 versions
AWS Pace of innovation
 Every month there are changes
 Changes mean APIs change (slightly)
 Very hard to keep up!
AWS Pace of innovation
 Every week there are announcements
 Changes mean APIs change (slightly)
 Very hard to keep up!
Lets start writing!
Hand write classes and
methods, and parameters
Hand write classes and
methods, and parameters
Parse docs
 After all… you would have to read them to write the
classes
Parse docs
 After all… you would have to read them to write the
classes
No published spec
 Introspect an official SDK!
 After all AWS already has read the docs for you
No published spec
 Introspect an official SDK!
 That’s your spec!
 After all AWS already has read the docs for you
Data driven SDKs!
 JS SDK has datastructures that define calls
 Proof of concept
 Win++! Boto and PHP2 too!
 Later migrate to using Boto
Data driven SDKs!
 JS SDK has datastructures that define calls
 Proof of concept
 Win++! Boto and PHP2 too!
 Later migrate to using Boto
The solutions
Modern Perl to the rescue
 Try to be very lazy
 Parameter validation: Create Moose classes that validate
the parameters passed to the call. May change in the
future.
 Got very quick results!
 Hide all possible implementation from the user
 Try not to leak implementation
 That way you can change it at will
 Meta lets you inspect the objects!
 Call objects get marshalled into datastructured via meta
 Result datastructures get marshalled into objects via meta
Roles
Modern Perl: Roles
 All functionality gets pulled in via Roles
 Code is basically in different roles, Classes are
“serialized configurations” of how to call APIs
 Makes it easy to
 Generate service classes from datastructures
 Change behaviour for tests
Roles are used for
 One global endpoint vs endpoints per region
 Caller (Query, JSON)
 Response (XML, JSON)
 Signatures (V2, V3, V4)
 IO
Aws is a class factory
Dynamic class construction
 User never constructs service classes directly
 Aws class method uses default config
my $ec2 = Aws->service(‘EC2’)->new( . . . )
Dynamic class construction
 User wants custom functionality
my $aws = Aws->new(
config => AWS::SDK::Config->new(
caller => 'Net::AWS::TestCaller‘
)
);
my $ec2 = $aws->service(‘EC2’)->new( . . . )
service loads Aws::EC2, creates a new class with TestCaller
Win: Hello to the async world
 Still playing around in examples
my $aws = Aws->new(
config => AWS::SDK::Config->new(
caller => 'Net::AWS::MojoCaller‘
)
);
my $ec2 = $aws->service(‘EC2’)->new( . . . )
my $asgs = $ec2->DescribeAutoScalingGroups;
See examples/asyncAutoScaling.pl
Win: Also going “fully async”
my $aws = Aws->new(
config => AWS::SDK::Config->new(caller => 'Net::AWS::MojoAsyncCaller')
);
my $delay = Mojo::IOLoop->delay(sub {
my ($delay, @responses) = @_;
Dumper($_) for @responses;
});
foreach my $region (
"us-east-1", "ap-northeast-1", "sa-east-1",
"ap-southeast-1", "ap-southeast-2", "us-west-2",
"us-west-1", "eu-west-1", 'invented-region') {
my $ctrail = $aws->service('CloudTrail')->new(
region => $region,
delay => $delay,
);
print "Doing a call for $regionn";
my $list = $ctrail->DescribeTrails;
}
$delay->wait;
Lessons Learned
Lessons learned
 First shot with MooseX::Declare
 Error messages are HORRIBLE!
 Change to Moops didn't go well
 Finally plain old Moose
Lessons learned
 Namespace finding (still in the works)
 AWS vs Aws
 Thanks @clintongormley for the article!
Lessons learned
 Enums (still in the works)
 APIs sometimes return unexpected stuff
Lessons learned
 Abstract $request object passed around
 Finally marshalled into the UserAgents’ taste
Still open stuff
 Load time for big services (EC2)
 Not all classes will be used all the time
 Generate classes on demand
 Calling convention
 Now CamelCased
 Not so perlish
 Calling from objects (not service objects)
 $queue->DeleteQueue(); from a queue object
 Attribute Traits
 Access to Arrays and HashRefs via nicer methods
 Lots more!!!
Use AWS? Use Perl? Want to
help?
 Fork your heart out:
https://github.com/pplu/aws-sdk-perl/

More Related Content

What's hot

Akka Actor presentation
Akka Actor presentationAkka Actor presentation
Akka Actor presentationGene Chang
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupRoy Russo
 
Drilling the Async Library
Drilling the Async LibraryDrilling the Async Library
Drilling the Async LibraryKnoldus Inc.
 
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)Amazon Web Services
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbsAWS Chicago
 
Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web ServersTroy Miles
 
Swift Ready for Production?
Swift Ready for Production?Swift Ready for Production?
Swift Ready for Production?Crispy Mountain
 
Akka london scala_user_group
Akka london scala_user_groupAkka london scala_user_group
Akka london scala_user_groupSkills Matter
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the HoodAmazon Web Services
 
Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014Björn Antonsson
 
Building Distributed Systems in Scala
Building Distributed Systems in ScalaBuilding Distributed Systems in Scala
Building Distributed Systems in ScalaAlex Payne
 
Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Jin k
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceAmazon Web Services
 
Algebird : Abstract Algebra for big data analytics. Devoxx 2014
Algebird : Abstract Algebra for big data analytics. Devoxx 2014Algebird : Abstract Algebra for big data analytics. Devoxx 2014
Algebird : Abstract Algebra for big data analytics. Devoxx 2014Samir Bessalah
 
Scala in a wild enterprise
Scala in a wild enterpriseScala in a wild enterprise
Scala in a wild enterpriseRafael Bagmanov
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
Advanced RxJS: Animations
Advanced RxJS: AnimationsAdvanced RxJS: Animations
Advanced RxJS: AnimationsBen Lesh
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend appsOtto Chrons
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013Amazon Web Services
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matterSkills Matter
 

What's hot (20)

Akka Actor presentation
Akka Actor presentationAkka Actor presentation
Akka Actor presentation
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Drilling the Async Library
Drilling the Async LibraryDrilling the Async Library
Drilling the Async Library
 
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 
Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web Servers
 
Swift Ready for Production?
Swift Ready for Production?Swift Ready for Production?
Swift Ready for Production?
 
Akka london scala_user_group
Akka london scala_user_groupAkka london scala_user_group
Akka london scala_user_group
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood
 
Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014
 
Building Distributed Systems in Scala
Building Distributed Systems in ScalaBuilding Distributed Systems in Scala
Building Distributed Systems in Scala
 
Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管Amazon Route53へのドメイン移管
Amazon Route53へのドメイン移管
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
Algebird : Abstract Algebra for big data analytics. Devoxx 2014
Algebird : Abstract Algebra for big data analytics. Devoxx 2014Algebird : Abstract Algebra for big data analytics. Devoxx 2014
Algebird : Abstract Algebra for big data analytics. Devoxx 2014
 
Scala in a wild enterprise
Scala in a wild enterpriseScala in a wild enterprise
Scala in a wild enterprise
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Advanced RxJS: Animations
Advanced RxJS: AnimationsAdvanced RxJS: Animations
Advanced RxJS: Animations
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend apps
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matter
 

Viewers also liked

Writing plugins for Nagios and Opsview - CAPSiDE Tech Talks
Writing plugins for Nagios and Opsview - CAPSiDE Tech TalksWriting plugins for Nagios and Opsview - CAPSiDE Tech Talks
Writing plugins for Nagios and Opsview - CAPSiDE Tech TalksJose Luis Martínez
 
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talkMooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talkJose Luis Martínez
 
Estilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjaEstilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjavitorneves79
 
My music based magazine evaluation
My music based magazine evaluationMy music based magazine evaluation
My music based magazine evaluationkamar95
 
iPad Game Design -- Develop Liverpool Dec' 2011
iPad Game Design -- Develop Liverpool Dec' 2011iPad Game Design -- Develop Liverpool Dec' 2011
iPad Game Design -- Develop Liverpool Dec' 2011garethjenkins
 
Garm2 raton sin pilas
Garm2 raton sin pilasGarm2 raton sin pilas
Garm2 raton sin pilasjaiip
 
Results for my first drafts
Results for my first draftsResults for my first drafts
Results for my first draftskamar95
 
Feedback from the first versions of my music
Feedback from the first versions of my musicFeedback from the first versions of my music
Feedback from the first versions of my musickamar95
 
Make Extra Income Online
Make Extra Income OnlineMake Extra Income Online
Make Extra Income Onlinewebwhisker
 
Kutner and olsen
Kutner and olsenKutner and olsen
Kutner and olsenkamar95
 
How to use photoshop
How to use photoshopHow to use photoshop
How to use photoshopkamar95
 
Proposal
ProposalProposal
Proposalramcoza
 
Daniel & Ernesto's presentation
Daniel & Ernesto's presentationDaniel & Ernesto's presentation
Daniel & Ernesto's presentationErnesto Sepulveda
 
My fist drafts presnetation
My fist drafts presnetationMy fist drafts presnetation
My fist drafts presnetationkamar95
 

Viewers also liked (20)

Boosting MySQL (for starters)
Boosting MySQL (for starters)Boosting MySQL (for starters)
Boosting MySQL (for starters)
 
Writing plugins for Nagios and Opsview - CAPSiDE Tech Talks
Writing plugins for Nagios and Opsview - CAPSiDE Tech TalksWriting plugins for Nagios and Opsview - CAPSiDE Tech Talks
Writing plugins for Nagios and Opsview - CAPSiDE Tech Talks
 
Plenv and carton
Plenv and cartonPlenv and carton
Plenv and carton
 
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talkMooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
 
Estilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mjaEstilo apa 6aed_directrizes_gerais_mja
Estilo apa 6aed_directrizes_gerais_mja
 
My music based magazine evaluation
My music based magazine evaluationMy music based magazine evaluation
My music based magazine evaluation
 
iPad Game Design -- Develop Liverpool Dec' 2011
iPad Game Design -- Develop Liverpool Dec' 2011iPad Game Design -- Develop Liverpool Dec' 2011
iPad Game Design -- Develop Liverpool Dec' 2011
 
Pptplan morgenjuli2011 pptbehandelcoordinatoren
Pptplan morgenjuli2011 pptbehandelcoordinatorenPptplan morgenjuli2011 pptbehandelcoordinatoren
Pptplan morgenjuli2011 pptbehandelcoordinatoren
 
Polifonia_6.16
Polifonia_6.16Polifonia_6.16
Polifonia_6.16
 
Garm2 raton sin pilas
Garm2 raton sin pilasGarm2 raton sin pilas
Garm2 raton sin pilas
 
Results for my first drafts
Results for my first draftsResults for my first drafts
Results for my first drafts
 
Success factors in football
Success factors in footballSuccess factors in football
Success factors in football
 
Feedback from the first versions of my music
Feedback from the first versions of my musicFeedback from the first versions of my music
Feedback from the first versions of my music
 
Make Extra Income Online
Make Extra Income OnlineMake Extra Income Online
Make Extra Income Online
 
Kutner and olsen
Kutner and olsenKutner and olsen
Kutner and olsen
 
Bloedsomloop versie 1.0
Bloedsomloop versie 1.0Bloedsomloop versie 1.0
Bloedsomloop versie 1.0
 
How to use photoshop
How to use photoshopHow to use photoshop
How to use photoshop
 
Proposal
ProposalProposal
Proposal
 
Daniel & Ernesto's presentation
Daniel & Ernesto's presentationDaniel & Ernesto's presentation
Daniel & Ernesto's presentation
 
My fist drafts presnetation
My fist drafts presnetationMy fist drafts presnetation
My fist drafts presnetation
 

Similar to Building an aws sdk for Perl - Granada Perl Workshop 2014

Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Amazon Web Services
 
Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineAmazon Web Services
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldAmazon Web Services
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sOrtus Solutions, Corp
 
AWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAmazon Web Services
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDanilo Poccia
 
AWS meets Continuous Delivery
AWS meets Continuous DeliveryAWS meets Continuous Delivery
AWS meets Continuous DeliveryAndreas Mohrhard
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyRobert Dempsey
 
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)Julien SIMON
 
Building and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSBuilding and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSJoris Kuipers
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenchesYan Cui
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAmazon Web Services
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupAmazon Web Services
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWSAmazon Web Services Korea
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Amazon Web Services
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!David Lapsley
 

Similar to Building an aws sdk for Perl - Granada Perl Workshop 2014 (20)

Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
Continuous Integration e Delivery per (r)innovare lo sviluppo software e la g...
 
Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules Engine
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
VAaaS
VAaaSVAaaS
VAaaS
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api's
 
AWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWSAWS Startup Webinar | Developing on AWS
AWS Startup Webinar | Developing on AWS
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
AWS meets Continuous Delivery
AWS meets Continuous DeliveryAWS meets Continuous Delivery
AWS meets Continuous Delivery
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with Ruby
 
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)
 
Building and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSBuilding and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECS
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and Docker
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a Startup
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!
 
SRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS BatchSRV410 Deep Dive on AWS Batch
SRV410 Deep Dive on AWS Batch
 

More from Jose Luis Martínez

More from Jose Luis Martínez (10)

Being cloudy with perl
Being cloudy with perlBeing cloudy with perl
Being cloudy with perl
 
Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)
 
Escribir plugins para Nagios en Perl
Escribir plugins para Nagios en PerlEscribir plugins para Nagios en Perl
Escribir plugins para Nagios en Perl
 
NRD: Nagios Result Distributor
NRD: Nagios Result DistributorNRD: Nagios Result Distributor
NRD: Nagios Result Distributor
 
Writing nagios plugins in perl
Writing nagios plugins in perlWriting nagios plugins in perl
Writing nagios plugins in perl
 
Ficheros y directorios
Ficheros y directoriosFicheros y directorios
Ficheros y directorios
 
DBIx::Class
DBIx::ClassDBIx::Class
DBIx::Class
 
DBI
DBIDBI
DBI
 
The modern perl toolchain
The modern perl toolchainThe modern perl toolchain
The modern perl toolchain
 
Introducción a las Expresiones Regulares
Introducción a las Expresiones RegularesIntroducción a las Expresiones Regulares
Introducción a las Expresiones Regulares
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Building an aws sdk for Perl - Granada Perl Workshop 2014

  • 1. Building an AWS SDK Granada Perl Workshop 2014 Jose Luis Martinez JLMARTIN on CPAN Twitter: @pplu_io joseluis.martinez@capside.com
  • 2. About me  CTO @CAPSiDE  Training Partner for AWS  Delivering AWS official training  All four AWS certifications  Real experience with real platforms  Deliver consulting and continuous operation  Writing Perl for +10 years  And still having fun with it!
  • 3. About AWS  Mostly known for EC2 and S3  But lot's more services! (+30)  Everything is an API  “Programmable datacenter”  Software Defined Everything
  • 4. About AWS  Mostly known for EC2 and S3  But lot's more services! (+30)  Everything is an API  “Programmable datacenter”  Software Defined Everything It’s the your wet dream
  • 5. Perl & AWS Bad news   No official SDK  Official ones: Ruby, PHP, Python, JS, .Net, Java  Note: python wasn't official initially!
  • 6. Perl & AWS Good news   CPAN  And an active community  Lots of modules for different services (sometimes more than one)
  • 7. Perl & AWS: The CPAN  Inconsistencies  In method naming  Arbitrary defaults ('eu-west-1', 'us-east-1')  Not up to date with latest APIs  Keeping up with AWS is hard!!!  “Not so popular” services not covered  IAM, CloudFormation, SWF, RedShift, CloudSearch, etc  Almost no Role support  AWS::CLIWrapper is a good generic solution. Not native
  • 8. So lets write an entire SDK!
  • 9.
  • 11. You can end up with… or
  • 12. Challenges: # of services  30+ services  Some with 100+ API calls  Each call with it’s parameters  Want to return objects  Evolution
  • 13. Challenges: # of services
  • 14. So lets start classifying
  • 15. Challenges: Endpoints Endpoint Type Services Regional Services available in a región the rest Single Global services 6
  • 16. Challenges: WebService Types One URL REST Params: Query Response: XML 17 3 Params: JSON Response: JSON 10 1
  • 17. Challenges: Signatures Type Services v2 2 v3https 1 cloudfront 1 v4 the rest
  • 18. Challenges: API versions  More tan one API version is live  That’s why not-up-to-date callers still work  RDS  4 versions  CloudFront  3 versions  EC2  4 versions
  • 19. AWS Pace of innovation  Every month there are changes  Changes mean APIs change (slightly)  Very hard to keep up!
  • 20. AWS Pace of innovation  Every week there are announcements  Changes mean APIs change (slightly)  Very hard to keep up!
  • 22. Hand write classes and methods, and parameters
  • 23. Hand write classes and methods, and parameters
  • 24. Parse docs  After all… you would have to read them to write the classes
  • 25. Parse docs  After all… you would have to read them to write the classes
  • 26. No published spec  Introspect an official SDK!  After all AWS already has read the docs for you
  • 27. No published spec  Introspect an official SDK!  That’s your spec!  After all AWS already has read the docs for you
  • 28. Data driven SDKs!  JS SDK has datastructures that define calls  Proof of concept  Win++! Boto and PHP2 too!  Later migrate to using Boto
  • 29. Data driven SDKs!  JS SDK has datastructures that define calls  Proof of concept  Win++! Boto and PHP2 too!  Later migrate to using Boto
  • 31. Modern Perl to the rescue  Try to be very lazy  Parameter validation: Create Moose classes that validate the parameters passed to the call. May change in the future.  Got very quick results!  Hide all possible implementation from the user  Try not to leak implementation  That way you can change it at will  Meta lets you inspect the objects!  Call objects get marshalled into datastructured via meta  Result datastructures get marshalled into objects via meta
  • 32. Roles
  • 33. Modern Perl: Roles  All functionality gets pulled in via Roles  Code is basically in different roles, Classes are “serialized configurations” of how to call APIs  Makes it easy to  Generate service classes from datastructures  Change behaviour for tests
  • 34. Roles are used for  One global endpoint vs endpoints per region  Caller (Query, JSON)  Response (XML, JSON)  Signatures (V2, V3, V4)  IO
  • 35. Aws is a class factory
  • 36. Dynamic class construction  User never constructs service classes directly  Aws class method uses default config my $ec2 = Aws->service(‘EC2’)->new( . . . )
  • 37. Dynamic class construction  User wants custom functionality my $aws = Aws->new( config => AWS::SDK::Config->new( caller => 'Net::AWS::TestCaller‘ ) ); my $ec2 = $aws->service(‘EC2’)->new( . . . ) service loads Aws::EC2, creates a new class with TestCaller
  • 38. Win: Hello to the async world  Still playing around in examples my $aws = Aws->new( config => AWS::SDK::Config->new( caller => 'Net::AWS::MojoCaller‘ ) ); my $ec2 = $aws->service(‘EC2’)->new( . . . ) my $asgs = $ec2->DescribeAutoScalingGroups; See examples/asyncAutoScaling.pl
  • 39. Win: Also going “fully async” my $aws = Aws->new( config => AWS::SDK::Config->new(caller => 'Net::AWS::MojoAsyncCaller') ); my $delay = Mojo::IOLoop->delay(sub { my ($delay, @responses) = @_; Dumper($_) for @responses; }); foreach my $region ( "us-east-1", "ap-northeast-1", "sa-east-1", "ap-southeast-1", "ap-southeast-2", "us-west-2", "us-west-1", "eu-west-1", 'invented-region') { my $ctrail = $aws->service('CloudTrail')->new( region => $region, delay => $delay, ); print "Doing a call for $regionn"; my $list = $ctrail->DescribeTrails; } $delay->wait;
  • 40.
  • 42. Lessons learned  First shot with MooseX::Declare  Error messages are HORRIBLE!  Change to Moops didn't go well  Finally plain old Moose
  • 43. Lessons learned  Namespace finding (still in the works)  AWS vs Aws  Thanks @clintongormley for the article!
  • 44. Lessons learned  Enums (still in the works)  APIs sometimes return unexpected stuff
  • 45. Lessons learned  Abstract $request object passed around  Finally marshalled into the UserAgents’ taste
  • 46. Still open stuff  Load time for big services (EC2)  Not all classes will be used all the time  Generate classes on demand  Calling convention  Now CamelCased  Not so perlish  Calling from objects (not service objects)  $queue->DeleteQueue(); from a queue object  Attribute Traits  Access to Arrays and HashRefs via nicer methods  Lots more!!!
  • 47. Use AWS? Use Perl? Want to help?  Fork your heart out: https://github.com/pplu/aws-sdk-perl/