Slide 1

Slide 1 text

Perl meets AWS Lambda YAPC::Tokyo 2019 @moznion

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

͜Ε͸ӕʂʂʂʂ

Slide 4

Slide 4 text

AWS Lambdaͷ͓࿩

Slide 5

Slide 5 text

AWS Lambda - ୹͍ϫϯγϣοτͷίϯϐϡʔςΟϯά ϦιʔεΛఏڙ (࠷ۙ͸5෼͔Β15෼ʹ) - αʔόϨεͱ͔ݺ͹ΕͯΔ΍ͭͰ͢ʢࡶʣ

Slide 6

Slide 6 text

͍ͭʹAWS LambdaʹΞϨ͕དྷ·ͨ͠Ͷ

Slide 7

Slide 7 text

͍ͭʹAWS LambdaʹΞϨ͕དྷ·ͨ͠Ͷ Ruby

Slide 8

Slide 8 text

YAPCͩͧʂʂʂ

Slide 9

Slide 9 text

AWS Lambda Layers

Slide 10

Slide 10 text

AWS Lambda Layers - ೚ҙͷϥϯλΠϜΛLambda্Ͱಈ͔ͤΔ࢓૊Έ - ϥϯλΠϜͱbootstrapΛzipʹΞʔΧΠϒͯ͠ Ξοϓϩʔυ - See Also https://docs.aws.amazon.com/lambda/latest/ dg/configuration-layers.html

Slide 11

Slide 11 text

bootstrap - LayerͷίΞίϯϙʔωϯτ - Lambda FunctionͰLayerΛ༗ޮʹ͢Δͱ
 ͜ͷbootstrap͕ୟ͔ΕΔ

Slide 12

Slide 12 text

3. Do function bootstrap bootstrap AWS platform 1. Next Invocation API 2. Event 4. Invocation Response/Error

Slide 13

Slide 13 text

γϯϓϧͰ͢Ͷ

Slide 14

Slide 14 text

AWS Lambda Layers - ೚ҙͷϥϯλΠϜΛLambda্Ͱಈ͔ͤΔ࢓૊Έ - ϥϯλΠϜͱbootstrapΛzipʹΞʔΧΠϒͯ͠ Ξοϓϩʔυ - See Also https://docs.aws.amazon.com/lambda/latest/ dg/configuration-layers.html

Slide 15

Slide 15 text

AWS Lambda Layers - ೚ҙͷϥϯλΠϜΛLambda্Ͱಈ͔ͤΔ࢓૊Έ - ϥϯλΠϜͱbootstrapΛzipʹΞʔΧΠϒͯ͠ Ξοϓϩʔυ - See Also https://docs.aws.amazon.com/lambda/latest/ dg/configuration-layers.html

Slide 16

Slide 16 text

AWS Lambda Layers - ೚ҙͷϥϯλΠϜΛLambda্Ͱಈ͔ͤΔ࢓૊Έ - ϥϯλΠϜͱbootstrapΛzipʹΞʔΧΠϒͯ͠ Ξοϓϩʔυ - See Also https://docs.aws.amazon.com/lambda/latest/ dg/configuration-layers.html Perl

Slide 17

Slide 17 text

aws-lambda-perl5-layer

Slide 18

Slide 18 text

Perl Lambda Layer - Repository: https://github.com/moznion/aws- lambda-perl5-layer - Blog: aws-lambda-perl5-layer ॻ͍ͨ -

Slide 19

Slide 19 text

Perl Lambda Layer - Ϟνϕʔγϣϯ - ੜ͖͍ͯΔͱ͍Ζ͍Ζ͋Δ - ஌త޷ح৺ - ੜ͖͍ͯΔͱ͍Ζ͍Ζ͋Δ

Slide 20

Slide 20 text

Perl Lambda Layer - Layerͷ࡞Γํ - bootstrapΛॻ͘ - LambdaͷϕʔεDockerίϯςφʹperlΛΠϯετʔϧ - Πϯετʔϧͨ͠PerlϥϯλΠϜͱbootstrapΛzipʹݻΊΔ - Ξοϓϩʔυʂʂ

Slide 21

Slide 21 text

؆୯Ͱ͢Ͷ

Slide 22

Slide 22 text

Perl Lambda Layer - ಛ௃ - carton friendly - ϏϧυࡁΈLayerఏڙ͋Γ - arn:aws:lambda:${REGION}:652718333417:layer:perl-5_26-layer:1 - arn:aws:lambda:${REGION}:652718333417:layer:perl-5_28-layer:1 - શAWSϦʔδϣϯαϙʔτ

Slide 23

Slide 23 text

Perl Lambda Layer - ap-northeast-1 - ap-northeast-2 - ap-south-1 - ap-southeast-1 - ap-southeast-2 - ca-central-1 - eu-central-1 - eu-west-1 - eu-west-2 - eu-west-3 - sa-east-1 - us-east-1 - us-east-2 - us-west-1 - us-west-2

Slide 24

Slide 24 text

Perl Lambda Layer - FunctionͷσϓϩΠํ๏ - (dependencyΛlocalҎԼʹvendoring͢Δ) - σΟϨΫτϦશମΛzipʹ·ͱΊΔ

Slide 25

Slide 25 text

؆୯Ͱ͢Ͷʁ

Slide 26

Slide 26 text

͍΍ʔΊΜͲ͘Ͷʁ

Slide 27

Slide 27 text

͸͍……

Slide 28

Slide 28 text

……

Slide 29

Slide 29 text

App::Perlambda

Slide 30

Slide 30 text

App::Perlambda - aws-lambda-perl5-layer޲͚ͷϚωδϝϯτ
 CLIπʔϧ - dist, create, updateʹରԠ - https://github.com/moznion/p5-App-Perlambda

Slide 31

Slide 31 text

DEMO

Slide 32

Slide 32 text

·ͱΊ - Ruby͕AWS LambdaʹରԠ͠·ͨ͠ - AWS LambdaʹLayers͕΍͖ͬͯ·ͨ͠ - Perl͕LayerͷྗͰAWS LambdaʹରԠ͠·ͨ͠ - App::Perlambdaͱ͍͏ˢͷϚωδϝϯτπʔϧ Λॻ͖·ͨ͠

Slide 33

Slide 33 text

ॴײ - ࣮ࡍLambdaॻ͘ͳΒඇಉظॲཧ͠΍͍͢ݴޠΛ
 બΜͩ΄͏͕͍͍ͱࢥ͏…… - go - node - ͳͲ - ͳ͓ fork(2) ͸Ͳ͏΍Βಈ͘……

Slide 34

Slide 34 text

ͦͷଞ - ศརͦ͏ͳͷ͕ग़ͨ - https://github.com/awslabs/aws-lambda- container-image-converter

Slide 35

Slide 35 text

͓ΘΓ