SlideShare a Scribd company logo
Serverless Function
With Python and
AWS Lambda
Hello!
Nice to meet you
My Name is Fitrah Elly Firdaus. I am Software
Engineer at Traveloka.
Contact me at:
▪ fitrah.firdaus@gmail.com
▪ @FEF123
Table of contents 1. AWS Lambda
2. API Gateway
3. Python With Lambda
3
1.
AWS
Lambda
4
What is
AWS
Lambda
• Run code without thinking about servers. Pay only for the
compute time you consume.
• First 1M requests per month are free.
• 400.000 GB-Seconds of compute time per month, free.
• $0.20 per 1M requests thereafter, $0.0000002 per request.
• $0.00001667 for every GB-Second used thereafter
• Supported Language: Python, Go, Java, NodeJS, C#
5
How It
Works
6
Use Cases • Data Processing
• Real Time File Processing
• Real Time Stream Processing
• Extract, Transform and Load
• Backend
• IOT Backends
• Mobile Backends
• Web Applications
7
Lambda
Designer
8
2. AWS API
Gateway
9
What is API
Gateway
• Create, Maintain, and secure API at any scale
• First 1M API Calls per month are free
• $4.25 per million API calls received, plus the cost of data
transfer out, in gigabytes.
10
What can be
integrate?
11
3. Python
With
Lambda
12
General
Syntax
Structure
def handler_name(event, context):
...
return some_value
13
What is
event?
• Usually python dict type
• list
• str
• int
• float
• NoneType
• Proxy Integration if using API Gateway
14
What is
context
• This information usually contain
• How much time is remaining before AWS Lambda
terminates your Lambda function
• Cloudwatch log group
• AWS Request ID
• Mobile Application function, if called from mobile apps
15
What is
context
Object
Methods
• get_remaining_time_in_millis()
• Returns the remaining execution time, in milliseconds,
until AWS Lambda terminates the function.
16
What is
context
Object
attributes
• function_name
• function_version
• invoked_function_arn
• memory_limit_in_mb
• aws_request_id
• log_group_name
• log_stream_name
• identity
• client_context
17
Format of a
Lambda
Function for
Proxy
Integration
{
"isBase64Encoded": true|false,
"statusCode": httpStatusCode,
"headers": { "headerName": "headerValue", ... },
"body": "...”
}
18
How to log
the handler
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def my_logging_handler(event, context):
logger.info('got event{}'.format(event))
logger.error('something went wrong’)
return 'Hello from Lambda!'
19
CloudWatch
20
How to
create
exception
def always_failed_handler(event, context):
raise Exception('I failed!')
21
LITTLE DEMO
https://github.com/fitrah-firdaus/Simple-Crud-
Lambda-Python
22
Thank you very much
for your time
23
If you have any questions about this document
please don’t hesitate to contact me at:
▪ fitrah.firdaus@gmail.com
▪ @FEF123
▪ @pythonID

More Related Content

PPTX
ServerlessPresentation
Rohit Kumar
 
PDF
Serverless Node.js
The Software House
 
PDF
Microservices with AWS Lambda and the Serverless Framework
Rowell Belen
 
PPTX
Aws serverless architecture
genesesoftware
 
PDF
Node.js server side render in the Age of APIs - Full Stack Toronto 2017
Ruy Adorno
 
PPTX
Going Serverless with AWS Lambda at ReportGarden
Jay Gandhi
 
PPTX
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Lucas Jellema
 
PDF
Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...
Maciej Szymczyk
 
ServerlessPresentation
Rohit Kumar
 
Serverless Node.js
The Software House
 
Microservices with AWS Lambda and the Serverless Framework
Rowell Belen
 
Aws serverless architecture
genesesoftware
 
Node.js server side render in the Age of APIs - Full Stack Toronto 2017
Ruy Adorno
 
Going Serverless with AWS Lambda at ReportGarden
Jay Gandhi
 
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Lucas Jellema
 
Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...
Maciej Szymczyk
 

What's hot (20)

PDF
Keep Calm And Serilog Elasticsearch Kibana on .NET Core
Maciej Szymczyk
 
PDF
Serverless Framework (2018)
Rowell Belen
 
PPTX
Using AWS Lambda for Infrastructure Automation and Beyond
Nick Tursky
 
PPTX
2016 - Serverless Microservices on AWS with API Gateway and Lambda
devopsdaysaustin
 
PPTX
A (XPages) developers guide to Cloudant - MeetIT
Frank van der Linden
 
PPTX
MongoDB World 2019: Distributed Transactions: With Great Power Comes Great Re...
MongoDB
 
PPTX
Serverless by examples and case studies
CodeOps Technologies LLP
 
PDF
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
apidays
 
PPTX
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
Frank van der Linden
 
PDF
GraphQL API on a Serverless Environment
Itai Yaffe
 
PPTX
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Srushith Repakula
 
PPTX
MongoDB World 2018: Replatforming: Switching to MongoDB for Flexibility, Scal...
MongoDB
 
PDF
AWS Lambda + AWS Cloudformation
Jordi Miguel
 
PPTX
Elk meetup boston - logz.io
tomerlevy9
 
PPTX
Elk meetup
Asaf Yigal
 
PDF
PloneConf2017: serverless python for astronaut safety
Chris Shenton
 
PDF
Kubernetes for Sales Engineers & Solutions Engineers–You Too Can Leverage Kub...
AWS Chicago
 
PPTX
An experiment with AWS Lambda
Daniel Vaughan
 
PPTX
Journey to the cloud
Mikhail Advani
 
PDF
Serverless haskell
David Overton
 
Keep Calm And Serilog Elasticsearch Kibana on .NET Core
Maciej Szymczyk
 
Serverless Framework (2018)
Rowell Belen
 
Using AWS Lambda for Infrastructure Automation and Beyond
Nick Tursky
 
2016 - Serverless Microservices on AWS with API Gateway and Lambda
devopsdaysaustin
 
A (XPages) developers guide to Cloudant - MeetIT
Frank van der Linden
 
MongoDB World 2019: Distributed Transactions: With Great Power Comes Great Re...
MongoDB
 
Serverless by examples and case studies
CodeOps Technologies LLP
 
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
apidays
 
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
Frank van der Linden
 
GraphQL API on a Serverless Environment
Itai Yaffe
 
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Srushith Repakula
 
MongoDB World 2018: Replatforming: Switching to MongoDB for Flexibility, Scal...
MongoDB
 
AWS Lambda + AWS Cloudformation
Jordi Miguel
 
Elk meetup boston - logz.io
tomerlevy9
 
Elk meetup
Asaf Yigal
 
PloneConf2017: serverless python for astronaut safety
Chris Shenton
 
Kubernetes for Sales Engineers & Solutions Engineers–You Too Can Leverage Kub...
AWS Chicago
 
An experiment with AWS Lambda
Daniel Vaughan
 
Journey to the cloud
Mikhail Advani
 
Serverless haskell
David Overton
 
Ad

Similar to Serverless Function With Python and AWS Lambda (17)

PDF
Microservices Manchester: Serverless Architectures By Rafal Gancarz
OpenCredo
 
PDF
AWS Lambda Presentation (Tech Talk DC)
Doguhan Uluca
 
PPTX
Introduction to Aws lambda and build first application | Namespace IT
namespaceit
 
PDF
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
PPTX
Lambda and serverless - DevOps North East Jan 2017
Mike Shutlar
 
PPTX
AWS and Serverless with Alexa
Rory Preddy
 
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
How Serverless Changes DevOps
Richard Donkin
 
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
Ortus Solutions, Corp
 
PDF
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SmartWave
 
PPTX
Building serverless app_using_aws_lambda_b4usolution
Hoa Le
 
PDF
用Serverless技術快速開發line聊天機器人
Kevin Luo
 
PPTX
AWS for the Java Developer
Rory Preddy
 
PDF
Lambdaless and AWS CDK
MooYeol Lee
 
PDF
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
MongoDB
 
PDF
AWS for Java Developers workshop
Rory Preddy
 
PPTX
Serverless architectures on aws
Paolo latella
 
Microservices Manchester: Serverless Architectures By Rafal Gancarz
OpenCredo
 
AWS Lambda Presentation (Tech Talk DC)
Doguhan Uluca
 
Introduction to Aws lambda and build first application | Namespace IT
namespaceit
 
Čtvrtkon #64 - AWS Serverless - Michal Haták
Ctvrtkoncz
 
Lambda and serverless - DevOps North East Jan 2017
Mike Shutlar
 
AWS and Serverless with Alexa
Rory Preddy
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
How Serverless Changes DevOps
Richard Donkin
 
June Webinar: BoxLang-Dynamic-AWS-Lambda
Ortus Solutions, Corp
 
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SmartWave
 
Building serverless app_using_aws_lambda_b4usolution
Hoa Le
 
用Serverless技術快速開發line聊天機器人
Kevin Luo
 
AWS for the Java Developer
Rory Preddy
 
Lambdaless and AWS CDK
MooYeol Lee
 
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
MongoDB
 
AWS for Java Developers workshop
Rory Preddy
 
Serverless architectures on aws
Paolo latella
 
Ad

Recently uploaded (20)

PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PPTX
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PPTX
Services offered by Dynamic Solutions in Pakistan
DaniyaalAdeemShibli1
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Presentation about variables and constant.pptx
safalsingh810
 
oapresentation.pptx
mehatdhavalrajubhai
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Services offered by Dynamic Solutions in Pakistan
DaniyaalAdeemShibli1
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Role Of Python In Programing Language.pptx
jaykoshti048
 

Serverless Function With Python and AWS Lambda

Editor's Notes

  • #18: Information about the client application and device when invoked through the AWS Mobile SDK. It can be null. client_context.client.installation_id client_context.client.app_title client_context.client.app_version_name client_context.client.app_version_code client_context.client.app_package_name client_context.custom A dict of custom values set by the mobile client application. client_context.env A dict of environment information provided by the AWS Mobile SDK.