SlideShare ist ein Scribd-Unternehmen logo
1 von 47
©  2016,  Amazon  Web  Services,  Inc.  or  its  Affiliates.  All  rights  reserved.
Stefano  Buliani  – Product  Manager,  AWS
Geremy  Davey  – Chief  Architect,  Temando
Paul  Chiu,  Principal  Architect,  Temando
April  2016
Building  scalable  APIs  with  
Amazon  API  Gateway
Technical  201
Agenda
• What  is  Amazon  API  Gateway
• Why  use  Amazon  API  Gateway
• Amazon  API  Gateway  and  AWS  Lambda
• Temando Case  Study
• AWS  Service  Proxy
What  is  Amazon  API  Gateway
Internet
Mobile  Apps
Websites
Services
AWS  Lambda  
functions
AWS
API  Gateway  
Cache
Endpoints  on  
Amazon  EC2
Any  other  publicly  
accessible  endpointAmazon  
CloudWatch
Amazon  
CloudFront
Amazon  
API  Gateway
Why  Amazon  API  Gateway
Create  a  unified  API  
frontend  for  multiple  
micro-­services
DDoS  protection  
and  throttling  for  
your  backend
Authenticate  and  
authorise requests  
to  a  backend
Unified  Frontend
Unified  Frontend  – Migrating  to  AWS
InternetMobile  Apps Amazon
API  Gateway
On  premise  
web  server
1.  Use  API  Gateway  in  front  of  an  on-­premise web  service
2.  Port  the  web  service  to  AWS
3.  Change  integration  in  API  Gateway  to  call  the  
new  service
DDoS  Protection  and  Throttling
DDoS  and  Network  Protection
Internet
Mobile  Apps
Websites
Services
AWS  Lambda  
functions
Endpoints  on  
Amazon  EC2
Amazon  
CloudFront
Amazon  
API  Gateway
Layer  7  and  layer  3  DDoS  protection
Request  throttling  for  backend  services
Authorisation
Authorisation – AWS  Signature  Version  4
Mobile  Apps AWS  Lambda LambdaHandler
API  Gateway
Sigv4
Invoke  with  
caller  credentials
Service  calls  are
authorised using
the  IAM  Role  
DynamoDB
Authorisation – Custom  authorisers in  Lambda
Client
Lambda  Auth  
function
API  Gateway
OAuth token
OAuth
provider
Policy  is  
evaluated
Policy  is  
cached
Endpoints  on  
Amazon  EC2
Any  other  publicly  
accessible  endpoint
AWS  Lambda  
functions
403
Scalability,  Out  of  the  Box
Unmanaged  Scalability
VPC subnet
Availability Zone A Availability Zone B
VPC subnet
Auto Scaling group
WEB WEB
Oregon
Tokyo
VPC subnet
Cleanup
loop
EC2  API
start/stop
instances
JOBS
Managed
Managed  Scalability
InternetMobile  apps
AWS  Lambda  
functions
AWS
API  Gateway  
cache
Endpoints  on  
Amazon  EC2
Any  other  publicly  
accessible  endpoint
Amazon  
CloudWatch
Amazon  
CloudFront
API  
Gateway
API  Gateway
Other  AWS  
services
AWS  Lambda  
functions
Our  Customers
Why  they  use  Amazon  API  Gateway
• Running  as  high  as  200,000  requests  per  second
• Migrating  legacy  software  to  AWS  Lambda
• Using  AWS  Signature  Version  4  for  strong  auth
• Exposing  AWS  managed  services  as  their  own  APIs
API  Gateway  and  Lambda
Building  Secure,  Scalable  Backends
Method  and  Integration
Lambda  Invocations
API  Gateway  
1. Receives  the  request
2. Authorizes  the  request
3. Applies  mapping  templates
4. Invokes  Lambda  function
5. Applies  output  mappings
6. Responds  to  the  client
Input  Mapping:  Lambda  Accepts  an  Event  Body
#set($inputRoot = $input.path(‘$’)
{
“firstName”: “$input.params(‘firstName’)”,
“apiKey”: “$context.identity.apiKey”,
“items” : [
#foreach($elem in $inputRoot.Items)
{
“serviceName” :
“$util.escapeJavascript($elem.serviceName.S)”
,
“serviceId” : “$elem.serviceId.S”
}
#if(foreach.hasNext),#end
#end
]
}
POST:  /dev/hello?firstName=Bob
{
“Items” : [
{
“serviceName” : {
“S” : “Amazon API GAteway”
},
“serviceId” : {
“S” : “ApiGateway”
}
},
{
…
}
]
}
Invoke:  arn:aws:lambda:us-­east-­1:XXXXX:function:helloWorld
Output  Mapping:  Lambda  Returns  a  Body
{
“authHeader” : “XXXXXXXXXXXXXX”,
“body” : {
“name”: “Bob”,
“dateCreated” : 132323124123
}
}
HTTP STATUS: 200
HEADER:
x-Custom-Auth : XXXXXXXXXXX
BODY:
{
“name”: “Bob”,
“dateCreated” : 132323124123
}
X-Custom-Auth:
integration.response.body.authHeader
Mapping template:
$input.json(‘$.body’)
X-Amz-Function-Error: “” HTTP STATUS: ^$
Lambda  response Generated  HTTP  responseAPI  Gateway  mapping
-­ Over  50,000  registered  users  and  counting
-­ Global  Presence
-­ Offices  in  Brisbane,  Sydney,  San  Francisco,  Vietnam,  France  
We  offer  the  world’s  logistical  resources  in  a  single  intelligent  platform  to  
make  commerce  easy  and  universally  accessible.
First  Build
Scripting  Languages  and  Relational  Databases
are  awesome!
Initial  Architecture
Frameworks  and  ORM  will  solve  all  our  problems!
Increasing  Load
Load  Balancing  &  Vertical  Scaling  will   solve
all  our  problems!
Database  Performance
Active-­Active  database  clustering  will  solve
all  our  problems!
Big  AWS  Band-­Aid
*.temando.com
sso.temando.com
kpi-­dashboard.temando.com
dashboard.temando.com
my.temando.com
api.temando.com
shipping.temando.com
*.temando.io
Latency  Based
Routing
*.nala1.temando.io *.apac1.temando.io
CNAME
CNAME
Standard  Ingress
Forced  Localised
Ingress
Custom  Sub-­domain
CNAME
Future  Stacks*.emea1.temando.io
left.temando.io left.temando.io left.temando.io
NGINX NGINX NGINX
Future  Stacks
Future  Stacks
NALA1  SET APAC1  SET EMEA1  SET
MEMCAHED MEMCACHED MEMCACHED
Breaking  the  Cycle
Modular
Development
Micro-services
with Lambda
Service
Orientation
With API Gateway
Temando’s leading  enterprise  technology  will  be  Magento’s
preferred  method  for  carriers  to  integrate  into  Magento
API  Gateway  &  Lambda
Demonstration
Examples  of  seamlessly  surfacing  existing  functionality  including  authentication  
with  new  Lambda  Functionality
AWS  Service  Proxy
Expose  AWS  Services  as  Your  Own  API
1. Kinesis
• Customers  collecting  metrics  from  external  developers
2. SQS
• APIs  that  only  insert  a  record  in  a  queue
3. DynamoDB
• Easy  CRUD  APIs  with  Sigv4
4. AWS  IoT
• Expose  device  shadows  as  API  endpoints
Kinesis:  Configure  AWS  Service  Proxy
1. Select  AWS  Service  Proxy
2. Select  the  AWS  service:  Kinesis
3. HTTP  method  from  the  service  API:  POST
4. Set  the  desired  action:  PutRecord
5. The  Execution  Role  can  perform  the  action  
and  trusts  apigateway.amazonaws.com
Kinesis:  Transform  the  Request
1. Set  Kinesis’  content-­type:  x-­amz-­json-­1.1
2. Static  values  use  Single  Quotes:  ‘value’
3. Configure  Mapping  Template
1. Use  $util to  base64  encode
2. Use  $input  to  read  incoming  json
3. Static  Partition and  Stream Name
Demo
Takeaways
• Use  API  Gateway  to:
1. Abstract  the  implementation
2. Protect  your  service  from  attacks
3. Offload  authentication  and  authorization
• Serverless Architectures  allow  you  to:
1. Build  scalable  services  without  managing  any  
infrastructure
2. Easily  build  micro-­services’  driven  applications
Next  steps
• Go  to  the  API  Gateway  console:  https://console.aws.amazon.com/apigateway/home
• Use  the  example  API  to  get  started  quickly
• Learn  more  about  mapping  templates:  http://amzn.to/1L1hSF5
• Follow  the  AWS  compute  blog  for  updates:  http://amzn.to/1SfzoWD
AWS  Training  &  Certification
Intro  Videos  &  Labs  
Free  videos  and  labs  to  
help  you  learn  to  work  
with  30+  AWS  services  
– in  minutes!
Training  Classes
In-­person  and  online  
courses  to  build  
technical  skills  –
taught  by  accredited  
AWS  instructors
Online  Labs  
Practice  working  with  
AWS  services  in  live  
environment  –
Learn  how  related  
services  work  
together
AWS  Certification
Validate  technical  
skills  and  expertise  –
identify  qualified  IT  
talent  or  show  you  
are  AWS  cloud  ready
Learn  more:  aws.amazon.com/training
Your  Training  Next  Steps:
ü Visit  the  AWS  Training  &  Certification  pod  to  discuss  your  
training  plan  &  AWS  Summit  training  offer
ü Register  &  attend  AWS  instructor  led  training
ü Get  Certified
AWS  Certified?  Visit  the  AWS  Summit  Certification  Lounge  to  pick  up  your  swag
Learn  more:  aws.amazon.com/training
Thank  you!

Weitere ähnliche Inhalte

Was ist angesagt?

AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
Amazon Web Services Korea
 
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
Amazon Web Services Korea
 

Was ist angesagt? (20)

Amazon API Gateway and AWS Lambda: Better Together
Amazon API Gateway and AWS Lambda: Better TogetherAmazon API Gateway and AWS Lambda: Better Together
Amazon API Gateway and AWS Lambda: Better Together
 
AWS IAM Introduction
AWS IAM IntroductionAWS IAM Introduction
AWS IAM Introduction
 
Introduction To Amazon Web Services | AWS Tutorial for Beginners | AWS Traini...
Introduction To Amazon Web Services | AWS Tutorial for Beginners | AWS Traini...Introduction To Amazon Web Services | AWS Tutorial for Beginners | AWS Traini...
Introduction To Amazon Web Services | AWS Tutorial for Beginners | AWS Traini...
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
 
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdfAWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
 
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
 
[AWS Builders] AWS와 함께하는 클라우드 컴퓨팅
[AWS Builders] AWS와 함께하는 클라우드 컴퓨팅[AWS Builders] AWS와 함께하는 클라우드 컴퓨팅
[AWS Builders] AWS와 함께하는 클라우드 컴퓨팅
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
AWS VPC & Networking basic concepts
AWS VPC & Networking basic conceptsAWS VPC & Networking basic concepts
AWS VPC & Networking basic concepts
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best Practices
 
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
 
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 
Introduction To AWS & AWS Lambda
Introduction To AWS & AWS LambdaIntroduction To AWS & AWS Lambda
Introduction To AWS & AWS Lambda
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
Infrastructure is code with the AWS CDK - MAD312 - New York AWS Summit
Infrastructure is code with the AWS CDK - MAD312 - New York AWS SummitInfrastructure is code with the AWS CDK - MAD312 - New York AWS Summit
Infrastructure is code with the AWS CDK - MAD312 - New York AWS Summit
 
Amazon GuardDuty: Intelligent Threat Detection and Continuous Monitoring to P...
Amazon GuardDuty: Intelligent Threat Detection and Continuous Monitoring to P...Amazon GuardDuty: Intelligent Threat Detection and Continuous Monitoring to P...
Amazon GuardDuty: Intelligent Threat Detection and Continuous Monitoring to P...
 

Andere mochten auch

Craft Conference 2015 - Evolution of the PayPal API: Platform & Culture
Craft Conference 2015 - Evolution of the PayPal API: Platform & CultureCraft Conference 2015 - Evolution of the PayPal API: Platform & Culture
Craft Conference 2015 - Evolution of the PayPal API: Platform & Culture
Deepak Nadig
 
API Management architect presentation
API Management architect presentationAPI Management architect presentation
API Management architect presentation
sflynn073
 
Implementing API Facade using WSO2 API Management Platform
Implementing API Facade using WSO2 API Management PlatformImplementing API Facade using WSO2 API Management Platform
Implementing API Facade using WSO2 API Management Platform
WSO2
 

Andere mochten auch (20)

Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
 
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
Securing Serverless Workloads with Cognito and API Gateway Part I - AWS Secur...
 
WSO2Con EU 2016: Understanding the WSO2 API Management Platform
WSO2Con EU 2016: Understanding the WSO2 API Management PlatformWSO2Con EU 2016: Understanding the WSO2 API Management Platform
WSO2Con EU 2016: Understanding the WSO2 API Management Platform
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Best Practices for API Management
Best Practices for API Management Best Practices for API Management
Best Practices for API Management
 
Craft Conference 2015 - Evolution of the PayPal API: Platform & Culture
Craft Conference 2015 - Evolution of the PayPal API: Platform & CultureCraft Conference 2015 - Evolution of the PayPal API: Platform & Culture
Craft Conference 2015 - Evolution of the PayPal API: Platform & Culture
 
AWS re:Invent 2016: Serverless Authentication and Authorization: Identity Man...
AWS re:Invent 2016: Serverless Authentication and Authorization: Identity Man...AWS re:Invent 2016: Serverless Authentication and Authorization: Identity Man...
AWS re:Invent 2016: Serverless Authentication and Authorization: Identity Man...
 
API Management architect presentation
API Management architect presentationAPI Management architect presentation
API Management architect presentation
 
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
 
WSO2Con ASIA 2016: Understanding the WSO2 API Management Platform
WSO2Con ASIA 2016: Understanding the WSO2 API Management PlatformWSO2Con ASIA 2016: Understanding the WSO2 API Management Platform
WSO2Con ASIA 2016: Understanding the WSO2 API Management Platform
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
API Management Platform Technical Evaluation Framework
API Management Platform Technical Evaluation FrameworkAPI Management Platform Technical Evaluation Framework
API Management Platform Technical Evaluation Framework
 
Implementing API Facade using WSO2 API Management Platform
Implementing API Facade using WSO2 API Management PlatformImplementing API Facade using WSO2 API Management Platform
Implementing API Facade using WSO2 API Management Platform
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
AWS re:Invent 2016: Securing Serverless Architectures, and API Filtering at L...
AWS re:Invent 2016: Securing Serverless Architectures, and API Filtering at L...AWS re:Invent 2016: Securing Serverless Architectures, and API Filtering at L...
AWS re:Invent 2016: Securing Serverless Architectures, and API Filtering at L...
 
OAuth 101 & Secure APIs 2012 Cloud Identity Summit
OAuth 101 & Secure APIs 2012 Cloud Identity SummitOAuth 101 & Secure APIs 2012 Cloud Identity Summit
OAuth 101 & Secure APIs 2012 Cloud Identity Summit
 
Oracle api gateway overview
Oracle api gateway overviewOracle api gateway overview
Oracle api gateway overview
 
Oracle API Gateway
Oracle API GatewayOracle API Gateway
Oracle API Gateway
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 

Ähnlich wie Building Scalable Services with Amazon API Gateway - Technical 201

Ähnlich wie Building Scalable Services with Amazon API Gateway - Technical 201 (20)

Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)
 
Application Server-less Web Applications - Serverless Toronto Meetup
Application Server-less Web Applications - Serverless Toronto Meetup Application Server-less Web Applications - Serverless Toronto Meetup
Application Server-less Web Applications - Serverless Toronto Meetup
 
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
 
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
 
Build a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a RideBuild a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a Ride
 
Build a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a RideBuild a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a Ride
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Building serverless applications (April 2018)
Building serverless applications (April 2018)Building serverless applications (April 2018)
Building serverless applications (April 2018)
 
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)
 
AWS Serverless Development
AWS Serverless DevelopmentAWS Serverless Development
AWS Serverless Development
 
SMC305 Building CI/CD Pipelines for Serverless Applications
SMC305 Building CI/CD Pipelines for Serverless ApplicationsSMC305 Building CI/CD Pipelines for Serverless Applications
SMC305 Building CI/CD Pipelines for Serverless Applications
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
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
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
 

Mehr von Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Building Scalable Services with Amazon API Gateway - Technical 201

  • 1. ©  2016,  Amazon  Web  Services,  Inc.  or  its  Affiliates.  All  rights  reserved. Stefano  Buliani  – Product  Manager,  AWS Geremy  Davey  – Chief  Architect,  Temando Paul  Chiu,  Principal  Architect,  Temando April  2016 Building  scalable  APIs  with   Amazon  API  Gateway Technical  201
  • 2. Agenda • What  is  Amazon  API  Gateway • Why  use  Amazon  API  Gateway • Amazon  API  Gateway  and  AWS  Lambda • Temando Case  Study • AWS  Service  Proxy
  • 3. What  is  Amazon  API  Gateway Internet Mobile  Apps Websites Services AWS  Lambda   functions AWS API  Gateway   Cache Endpoints  on   Amazon  EC2 Any  other  publicly   accessible  endpointAmazon   CloudWatch Amazon   CloudFront Amazon   API  Gateway
  • 4. Why  Amazon  API  Gateway Create  a  unified  API   frontend  for  multiple   micro-­services DDoS  protection   and  throttling  for   your  backend Authenticate  and   authorise requests   to  a  backend
  • 6. Unified  Frontend  – Migrating  to  AWS InternetMobile  Apps Amazon API  Gateway On  premise   web  server 1.  Use  API  Gateway  in  front  of  an  on-­premise web  service 2.  Port  the  web  service  to  AWS 3.  Change  integration  in  API  Gateway  to  call  the   new  service
  • 7. DDoS  Protection  and  Throttling
  • 8. DDoS  and  Network  Protection Internet Mobile  Apps Websites Services AWS  Lambda   functions Endpoints  on   Amazon  EC2 Amazon   CloudFront Amazon   API  Gateway Layer  7  and  layer  3  DDoS  protection Request  throttling  for  backend  services
  • 10. Authorisation – AWS  Signature  Version  4 Mobile  Apps AWS  Lambda LambdaHandler API  Gateway Sigv4 Invoke  with   caller  credentials Service  calls  are authorised using the  IAM  Role   DynamoDB
  • 11. Authorisation – Custom  authorisers in  Lambda Client Lambda  Auth   function API  Gateway OAuth token OAuth provider Policy  is   evaluated Policy  is   cached Endpoints  on   Amazon  EC2 Any  other  publicly   accessible  endpoint AWS  Lambda   functions 403
  • 12. Scalability,  Out  of  the  Box
  • 13. Unmanaged  Scalability VPC subnet Availability Zone A Availability Zone B VPC subnet Auto Scaling group WEB WEB Oregon Tokyo VPC subnet Cleanup loop EC2  API start/stop instances JOBS
  • 14. Managed Managed  Scalability InternetMobile  apps AWS  Lambda   functions AWS API  Gateway   cache Endpoints  on   Amazon  EC2 Any  other  publicly   accessible  endpoint Amazon   CloudWatch Amazon   CloudFront API   Gateway API  Gateway Other  AWS   services AWS  Lambda   functions
  • 16. Why  they  use  Amazon  API  Gateway • Running  as  high  as  200,000  requests  per  second • Migrating  legacy  software  to  AWS  Lambda • Using  AWS  Signature  Version  4  for  strong  auth • Exposing  AWS  managed  services  as  their  own  APIs
  • 20. Lambda  Invocations API  Gateway   1. Receives  the  request 2. Authorizes  the  request 3. Applies  mapping  templates 4. Invokes  Lambda  function 5. Applies  output  mappings 6. Responds  to  the  client
  • 21. Input  Mapping:  Lambda  Accepts  an  Event  Body #set($inputRoot = $input.path(‘$’) { “firstName”: “$input.params(‘firstName’)”, “apiKey”: “$context.identity.apiKey”, “items” : [ #foreach($elem in $inputRoot.Items) { “serviceName” : “$util.escapeJavascript($elem.serviceName.S)” , “serviceId” : “$elem.serviceId.S” } #if(foreach.hasNext),#end #end ] } POST:  /dev/hello?firstName=Bob { “Items” : [ { “serviceName” : { “S” : “Amazon API GAteway” }, “serviceId” : { “S” : “ApiGateway” } }, { … } ] } Invoke:  arn:aws:lambda:us-­east-­1:XXXXX:function:helloWorld
  • 22. Output  Mapping:  Lambda  Returns  a  Body { “authHeader” : “XXXXXXXXXXXXXX”, “body” : { “name”: “Bob”, “dateCreated” : 132323124123 } } HTTP STATUS: 200 HEADER: x-Custom-Auth : XXXXXXXXXXX BODY: { “name”: “Bob”, “dateCreated” : 132323124123 } X-Custom-Auth: integration.response.body.authHeader Mapping template: $input.json(‘$.body’) X-Amz-Function-Error: “” HTTP STATUS: ^$ Lambda  response Generated  HTTP  responseAPI  Gateway  mapping
  • 23.
  • 24. -­ Over  50,000  registered  users  and  counting -­ Global  Presence -­ Offices  in  Brisbane,  Sydney,  San  Francisco,  Vietnam,  France   We  offer  the  world’s  logistical  resources  in  a  single  intelligent  platform  to   make  commerce  easy  and  universally  accessible.
  • 25.
  • 26. First  Build Scripting  Languages  and  Relational  Databases are  awesome!
  • 27. Initial  Architecture Frameworks  and  ORM  will  solve  all  our  problems!
  • 28. Increasing  Load Load  Balancing  &  Vertical  Scaling  will   solve all  our  problems!
  • 29. Database  Performance Active-­Active  database  clustering  will  solve all  our  problems!
  • 30.
  • 31.
  • 32. Big  AWS  Band-­Aid *.temando.com sso.temando.com kpi-­dashboard.temando.com dashboard.temando.com my.temando.com api.temando.com shipping.temando.com *.temando.io Latency  Based Routing *.nala1.temando.io *.apac1.temando.io CNAME CNAME Standard  Ingress Forced  Localised Ingress Custom  Sub-­domain CNAME Future  Stacks*.emea1.temando.io left.temando.io left.temando.io left.temando.io NGINX NGINX NGINX Future  Stacks Future  Stacks NALA1  SET APAC1  SET EMEA1  SET MEMCAHED MEMCACHED MEMCACHED
  • 35. Temando’s leading  enterprise  technology  will  be  Magento’s preferred  method  for  carriers  to  integrate  into  Magento
  • 36. API  Gateway  &  Lambda Demonstration Examples  of  seamlessly  surfacing  existing  functionality  including  authentication   with  new  Lambda  Functionality
  • 37.
  • 39. Expose  AWS  Services  as  Your  Own  API 1. Kinesis • Customers  collecting  metrics  from  external  developers 2. SQS • APIs  that  only  insert  a  record  in  a  queue 3. DynamoDB • Easy  CRUD  APIs  with  Sigv4 4. AWS  IoT • Expose  device  shadows  as  API  endpoints
  • 40. Kinesis:  Configure  AWS  Service  Proxy 1. Select  AWS  Service  Proxy 2. Select  the  AWS  service:  Kinesis 3. HTTP  method  from  the  service  API:  POST 4. Set  the  desired  action:  PutRecord 5. The  Execution  Role  can  perform  the  action   and  trusts  apigateway.amazonaws.com
  • 41. Kinesis:  Transform  the  Request 1. Set  Kinesis’  content-­type:  x-­amz-­json-­1.1 2. Static  values  use  Single  Quotes:  ‘value’ 3. Configure  Mapping  Template 1. Use  $util to  base64  encode 2. Use  $input  to  read  incoming  json 3. Static  Partition and  Stream Name
  • 42. Demo
  • 43. Takeaways • Use  API  Gateway  to: 1. Abstract  the  implementation 2. Protect  your  service  from  attacks 3. Offload  authentication  and  authorization • Serverless Architectures  allow  you  to: 1. Build  scalable  services  without  managing  any   infrastructure 2. Easily  build  micro-­services’  driven  applications
  • 44. Next  steps • Go  to  the  API  Gateway  console:  https://console.aws.amazon.com/apigateway/home • Use  the  example  API  to  get  started  quickly • Learn  more  about  mapping  templates:  http://amzn.to/1L1hSF5 • Follow  the  AWS  compute  blog  for  updates:  http://amzn.to/1SfzoWD
  • 45. AWS  Training  &  Certification Intro  Videos  &  Labs   Free  videos  and  labs  to   help  you  learn  to  work   with  30+  AWS  services   – in  minutes! Training  Classes In-­person  and  online   courses  to  build   technical  skills  – taught  by  accredited   AWS  instructors Online  Labs   Practice  working  with   AWS  services  in  live   environment  – Learn  how  related   services  work   together AWS  Certification Validate  technical   skills  and  expertise  – identify  qualified  IT   talent  or  show  you   are  AWS  cloud  ready Learn  more:  aws.amazon.com/training
  • 46. Your  Training  Next  Steps: ü Visit  the  AWS  Training  &  Certification  pod  to  discuss  your   training  plan  &  AWS  Summit  training  offer ü Register  &  attend  AWS  instructor  led  training ü Get  Certified AWS  Certified?  Visit  the  AWS  Summit  Certification  Lounge  to  pick  up  your  swag Learn  more:  aws.amazon.com/training