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

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

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/