39
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Markku Lepistö - Principal Technology Evangelist Python on Lambda

Python on AWS Lambda

Embed Size (px)

Citation preview

Page 1: Python on AWS Lambda

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Markku Lepistö - Principal Technology Evangelist

Python on Lambda

Page 2: Python on AWS Lambda
Page 3: Python on AWS Lambda

User Application

Application Service

Middleware Service

Language Interpreter

Operating System

Host

Focus on Your Application

Page 4: Python on AWS Lambda

Move Up the Stack

Page 5: Python on AWS Lambda

Application

Architecture

Page 6: Python on AWS Lambda
Page 7: Python on AWS Lambda
Page 8: Python on AWS Lambda
Page 9: Python on AWS Lambda
Page 10: Python on AWS Lambda
Page 11: Python on AWS Lambda

Adrian Cockcroft, Technology Fellow at Battery Ventures

http://www.slideshare.net/adriancockcroft/goto-berlin

Page 12: Python on AWS Lambda

Amazon Web Services

Page 13: Python on AWS Lambda
Page 14: Python on AWS Lambda

Containers Docker launched in 2013

Cloud EC2 launched in 2006

Virtualization Since late 1990s

Bare Metal Since 1960s

Page 15: Python on AWS Lambda

Lambda Launched in 2015

Containers Docker launched in 2013

Cloud EC2 launched in 2006

Virtualization Since late 1990s

Bare Metal Since 1960s

Page 16: Python on AWS Lambda

Event driven, fully managed compute

All you need is code™

Page 17: Python on AWS Lambda
Page 18: Python on AWS Lambda
Page 19: Python on AWS Lambda

Fast

events trigger code execution

in milliseconds – at any scale

Page 20: Python on AWS Lambda

Cost & Resource Efficient

100ms billing granularity

of compute chunks

Page 21: Python on AWS Lambda
Page 22: Python on AWS Lambda
Page 23: Python on AWS Lambda

Highly Requested by Customers Since Launch

Page 24: Python on AWS Lambda

Running Python on Lambda

Page 25: Python on AWS Lambda
Page 26: Python on AWS Lambda

Where can I use the AWS Python SDK ?

Your dev environment Amazon EC2 VM / Container AWS Lambda(install) (install) (pre-installed)

Page 27: Python on AWS Lambda

Programming model

Page 28: Python on AWS Lambda

Asynchronous Synchronous

Page 29: Python on AWS Lambda

handler_name event context

Page 30: Python on AWS Lambda

• Print

• Logger

AWS CloudWatch Logs

Page 31: Python on AWS Lambda

New Python lambda function from blueprint

• Lambda console

• Asynchronous – triggered by S3 event

• Debug & logs in Cloudwatch

• Identity and Access Management

• Exceptions handling

Page 32: Python on AWS Lambda

New Python ‘Hello World’ Lambda function

• Unit tests in Lambda console

• Synchronous – called by us

Page 33: Python on AWS Lambda

• Request ID (useful for troubleshooting)

• Time remaining (before ‘timed out’ function is killed)

• Memory available

• Info on calling client i.e Mobile app

• etc

Page 34: Python on AWS Lambda

context

context.log_stream_name

context.log_group_name

context.aws_request_id

context.memory_limit_in_mb

context.get_remaining_time_in_millis()

Page 35: Python on AWS Lambda

Let’s run the previous slide Context example

Page 36: Python on AWS Lambda
Page 37: Python on AWS Lambda

aws lambda create-function

Page 38: Python on AWS Lambda

• pip install zip

setup.cfg

[install]

prefix=

Page 39: Python on AWS Lambda

aws.amazon.com/lambda

@markkulepisto