SlideShare a Scribd company logo
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Stefano Buliani, Product Manager
07/29/2015
Build and Manage your APIs
with Amazon API Gateway
Agenda
Why we built Amazon API Gateway
What is Amazon API Gateway?
Amazon API Gateway Features & Functionality
Q&A
At AWS, We run a lot of APIs
…Over time, we have learned a few lessons
Your Feedback
Managing multiple versions and stages of an API is difficult
Monitoring 3rd party developers’ access is time consuming
Access authorization is a challenge
Traffic spikes create operational burden
What if I don’t want servers at all?
Host multiple versions and stages of your APIs
Create and distribute API Keys to developers
Leverage AWS Sigv4 to authorize access to APIs
Throttle and monitor requests to protect your backend
Utilizes AWS Lambda
Introducing Amazon API Gateway
Introducing Amazon API Gateway
Managed cache to store API responses
Reduced latency and DDoS protection through CloudFront
SDK Generation for iOS, Android and JavaScript
Swagger support
Request / Response data transformation and API mocking
How Does Amazon API
Gateway Work?
An API Call Flow
Internet
Mobile Apps
Websites
Services
API
Gateway
AWS Lambda
functions
AWS
API Gateway
Cache
Endpoints on
Amazon EC2
Any other publicly
accessible endpoint
Amazon
CloudWatch
Monitoring
Amazon
CloudFront
Methods and Integrations
Methods and Integrations
Build, Deploy, Clone & Rollback
Build APIs with their resources, methods, and settings
Deploy APIs to a Stage
• Users can create as many Stages as they want, each with its own
Throttling, Caching, Metering, and Logging configuration
Clone an existing API to create a new version
• Users can continue working on multiple versions of their APIs
Rollback to previous deployments
• We keep a history of customers’ deployments so they can revert to a
previous deployment
API Configuration
You can create APIs
Define resources within an API
Define methods for a resource
• Methods are Resource + HTTP verb
Pet Store
/pets
/pets/{petId}
• GET
• POST
• PUT
API Deployments
API Configuration can be deployed to a stage
Stages are different environments
For example:
• Dev (e.g. awsapigateway.com/dev)
• Beta (e.g. awsapigateway.com/beta)
• Prod (e.g. awsapigateway.com/prod)
• As many stages as you need
Pet Store
dev
beta
gamma
prod
Manage Multiple Versions and Stages of your APIs
API 1 (v1)
Stage (dev)
Stage (prod)
API 2 (v2)
Stage (dev)
Custom Domain Names
You can configure custom domain names with subdomains
and base paths
Pointing to an API you have access to all Stages
• Beta (e.g. yourapi.com/beta)
• Prod (e.g. yourapi.com/prod)
Pointing directly to your “prod” Stage
• Prod (e.g. yourapi.com/)
Metering and Authorization
API Keys to Meter Developer Usage
Create API Keys
Set access permissions at the API/Stage level
Meter usage of the API Keys through CloudWatch Logs
API Keys
API Keys should be used purely to meter
app/developer usage
API Keys should be used alongside a stronger
authorization mechanism
Leverage AWS Sigv4, or Use a Custom Header
You can leverage AWS Sigv4 to sign and authorize API calls
• Amazon Cognito and AWS Security Token Service (STS) simplify
the generation of temporary credentials for your app
You can support OAuth or other authorization mechanisms
through custom headers
• Simply configure your API methods to forward the custom headers
to you backend
Using Sigv4 to authenticate calls to your API
Call Login API,
no auth required
Client API Gateway Backend
/login
Lambda
fn_login
User
Accounts
database
Credentials
verified
Cognito developer
authenticated
identities
Access and
secret key
Receives
credentials to
sign API calls
/login
The AWSCredentialsProvider
We implement the AWSCredentialsProvider interface
The refresh() method is called whenever the SDK needs new credentials
AWS Services can use caller credentials
Throttling and Caching
API Throttling
Throttling helps you manage traffic to your backend
Throttle by developer-defined Requests/Sec limits
Requests over the limit are throttled
• HTTP 429 response
The generated SDKs retry throttled requests
Caching of API Responses
You can configure a cache key and the Time to Live (TTL) of
the API response
Cached items are returned without calling the backend
A cache is dedicated to you, by stage
You can provision between 0.5GB to 237GB of cache
Request processing workflow
Receive
incoming
request
• Check for item in
dedicated cache
• If found return
cached item
Check
throttling
configuration
• Check current RPS
rate
• If above allowed
rate return 429
Execute
backend call
Input / Output Transformation
Input / Output Transforms
Use Velocity Templates to transform data
Filter output results
• Remove private or unnecessary data
• Filter dataset size to improve API performance
GET to POST
• Read all query string parameters from your GET request, and create a body to make a POST
to your backend
JSON to XML
• Receive JSON input and transform it to XML for your backend
• Receive JSON from a Lambda function and transform it to XML
Transform Example: JSON to XML
API Gateway
Backend
GET - /sayHello
Lambda
fn_sayHello
/sayHello
{
“message” : “Hello world”
}
<xml>
<message>
Hello world
</message>
</xml>
#set($root = $input.path('$'))
<xml>
<message>
$root.message
</message>
</xml>
For Loops and if Statements
One Template per Content/Type
SDK Generation
API Models
Models are a JSON Schema representation of your API
requests and responses
You can reuse models across multiple methods in your API
Models are used to generate objects for the client SDK
Generate Client SDKs Based on Your APIs
SDKs are generated based on API deployments (Stages)
If Request and Response Models are defined, the SDK includes
input and output marshalling of your methods
SDKs know how to handle throttling responses
SDKs also know how to sign requests with AWS temporary
credentials (SigV4)
Support for Android, iOS, JavaScript, …
Models are included in the SDK
Models are generated using their name
Nested items inherit the name of their
parent model
The Client SDK Declares All Methods
Thank You
Q&A

More Related Content

What's hot

Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
Mark Bate
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
2016 - Serverless Microservices on AWS with API Gateway and Lambda
2016 - Serverless Microservices on AWS with API Gateway and Lambda2016 - Serverless Microservices on AWS with API Gateway and Lambda
2016 - Serverless Microservices on AWS with API Gateway and Lambda
devopsdaysaustin
 
(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
Amazon Web Services
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
Amazon Web Services
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
Muhammed YALÇIN
 
Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for Startups
Mark Bate
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Amazon Web Services
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Amazon Web Services
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
Yoel Spotts
 
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...
Amazon Web Services
 
Lamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api GatewayLamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api Gateway
Mike Becker
 
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
Vadim Zendejas
 
Convert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaConvert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS Lambda
Amazon Web Services
 
aws lambda & api gateway
aws lambda & api gatewayaws lambda & api gateway
aws lambda & api gateway
fumihiko hata
 
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS InfrastructureUsing AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
Amazon Web Services
 
Building Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureBuilding Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS Infrastructure
Amazon Web Services
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
Scott Leberknight
 

What's hot (20)

Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
 
2016 - Serverless Microservices on AWS with API Gateway and Lambda
2016 - Serverless Microservices on AWS with API Gateway and Lambda2016 - Serverless Microservices on AWS with API Gateway and Lambda
2016 - Serverless Microservices on AWS with API Gateway and Lambda
 
(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
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for Startups
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
 
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...
 
Lamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api GatewayLamdba micro service using Amazon Api Gateway
Lamdba micro service using Amazon Api Gateway
 
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
 
Convert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS LambdaConvert Your Code into a Microservice using AWS Lambda
Convert Your Code into a Microservice using AWS Lambda
 
aws lambda & api gateway
aws lambda & api gatewayaws lambda & api gateway
aws lambda & api gateway
 
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS InfrastructureUsing AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
 
Building Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureBuilding Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS Infrastructure
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 

Viewers also liked

(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
Amazon Web Services
 
Easily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS ResourcesEasily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS Resources
Amazon Web Services
 
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
Amazon Web Services
 
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
Amazon Web Services
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
Amazon Web Services
 
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
Amazon Web Services
 
DevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWSDevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWS
Amazon Web Services
 

Viewers also liked (7)

(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
 
Easily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS ResourcesEasily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS Resources
 
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
(NET409) How Twilio Migrated Its Services from EC2-Classic to EC2-VPC
 
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
(BDT307) Zero Infrastructure, Real-Time Data Collection, and Analytics
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
(GAM401) Build a Serverless Mobile Game w/ Cognito, Lambda & DynamoDB
 
DevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWSDevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWS
 

Similar to AWS July Webinar Series - Overview Build and Manage your APs with amazon api gateway_20150729-copy

Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
Amazon Web Services
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
Amazon Web Services
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Amazon Web Services
 
以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端
Amazon Web Services
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
Amazon 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 World
Amazon Web Services
 
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar SeriesContinuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Amazon Web Services
 
API Gateway with legend lambada
API Gateway with legend lambadaAPI Gateway with legend lambada
API Gateway with legend lambada
Squash Apps Pvt Ltd
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
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/burbs
AWS Chicago
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
Amazon 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 World
Amazon Web Services
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
Amazon Web Services
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
Amazon Web Services
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
Amazon Web Services
 
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
Amazon Web Services
 
Deep dive on Serverless application development
Deep dive on Serverless application developmentDeep dive on Serverless application development
Deep dive on Serverless application development
Amazon Web Services
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
Sachin G Kulkarni
 
API Testing with Open Source Code and Cucumber
API Testing with Open Source Code and CucumberAPI Testing with Open Source Code and Cucumber
API Testing with Open Source Code and Cucumber
SmartBear
 
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...
Amazon Web Services
 

Similar to AWS July Webinar Series - Overview Build and Manage your APs with amazon api gateway_20150729-copy (20)

Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 
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
 
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar SeriesContinuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
Continuous Delivery with AWS Lambda - AWS April 2016 Webinar Series
 
API Gateway with legend lambada
API Gateway with legend lambadaAPI Gateway with legend lambada
API Gateway with legend lambada
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
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
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
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
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
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
 
Deep dive on Serverless application development
Deep dive on Serverless application developmentDeep dive on Serverless application development
Deep dive on Serverless application development
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
API Testing with Open Source Code and Cucumber
API Testing with Open Source Code and CucumberAPI Testing with Open Source Code and Cucumber
API Testing with Open Source Code and Cucumber
 
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...
 

More from Amazon Web Services

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...
Amazon Web Services
 
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...
Amazon Web Services
 
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
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon Web Services
 
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
Amazon Web Services
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
Amazon Web Services
 
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...
Amazon Web Services
 
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...
Amazon Web Services
 
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
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon Web Services
 
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
Amazon Web Services
 
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
Amazon Web Services
 
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
Amazon Web Services
 
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
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 AWSAmazon 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 DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon 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
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from 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
 

AWS July Webinar Series - Overview Build and Manage your APs with amazon api gateway_20150729-copy

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Stefano Buliani, Product Manager 07/29/2015 Build and Manage your APIs with Amazon API Gateway
  • 2. Agenda Why we built Amazon API Gateway What is Amazon API Gateway? Amazon API Gateway Features & Functionality Q&A
  • 3. At AWS, We run a lot of APIs …Over time, we have learned a few lessons
  • 4. Your Feedback Managing multiple versions and stages of an API is difficult Monitoring 3rd party developers’ access is time consuming Access authorization is a challenge Traffic spikes create operational burden What if I don’t want servers at all?
  • 5. Host multiple versions and stages of your APIs Create and distribute API Keys to developers Leverage AWS Sigv4 to authorize access to APIs Throttle and monitor requests to protect your backend Utilizes AWS Lambda Introducing Amazon API Gateway
  • 6. Introducing Amazon API Gateway Managed cache to store API responses Reduced latency and DDoS protection through CloudFront SDK Generation for iOS, Android and JavaScript Swagger support Request / Response data transformation and API mocking
  • 7. How Does Amazon API Gateway Work?
  • 8. An API Call Flow Internet Mobile Apps Websites Services API Gateway AWS Lambda functions AWS API Gateway Cache Endpoints on Amazon EC2 Any other publicly accessible endpoint Amazon CloudWatch Monitoring Amazon CloudFront
  • 11. Build, Deploy, Clone & Rollback Build APIs with their resources, methods, and settings Deploy APIs to a Stage • Users can create as many Stages as they want, each with its own Throttling, Caching, Metering, and Logging configuration Clone an existing API to create a new version • Users can continue working on multiple versions of their APIs Rollback to previous deployments • We keep a history of customers’ deployments so they can revert to a previous deployment
  • 12. API Configuration You can create APIs Define resources within an API Define methods for a resource • Methods are Resource + HTTP verb Pet Store /pets /pets/{petId} • GET • POST • PUT
  • 13. API Deployments API Configuration can be deployed to a stage Stages are different environments For example: • Dev (e.g. awsapigateway.com/dev) • Beta (e.g. awsapigateway.com/beta) • Prod (e.g. awsapigateway.com/prod) • As many stages as you need Pet Store dev beta gamma prod
  • 14. Manage Multiple Versions and Stages of your APIs API 1 (v1) Stage (dev) Stage (prod) API 2 (v2) Stage (dev)
  • 15. Custom Domain Names You can configure custom domain names with subdomains and base paths Pointing to an API you have access to all Stages • Beta (e.g. yourapi.com/beta) • Prod (e.g. yourapi.com/prod) Pointing directly to your “prod” Stage • Prod (e.g. yourapi.com/)
  • 17. API Keys to Meter Developer Usage Create API Keys Set access permissions at the API/Stage level Meter usage of the API Keys through CloudWatch Logs
  • 18. API Keys API Keys should be used purely to meter app/developer usage API Keys should be used alongside a stronger authorization mechanism
  • 19. Leverage AWS Sigv4, or Use a Custom Header You can leverage AWS Sigv4 to sign and authorize API calls • Amazon Cognito and AWS Security Token Service (STS) simplify the generation of temporary credentials for your app You can support OAuth or other authorization mechanisms through custom headers • Simply configure your API methods to forward the custom headers to you backend
  • 20. Using Sigv4 to authenticate calls to your API Call Login API, no auth required Client API Gateway Backend /login Lambda fn_login User Accounts database Credentials verified Cognito developer authenticated identities Access and secret key Receives credentials to sign API calls /login
  • 21. The AWSCredentialsProvider We implement the AWSCredentialsProvider interface The refresh() method is called whenever the SDK needs new credentials
  • 22. AWS Services can use caller credentials
  • 24. API Throttling Throttling helps you manage traffic to your backend Throttle by developer-defined Requests/Sec limits Requests over the limit are throttled • HTTP 429 response The generated SDKs retry throttled requests
  • 25. Caching of API Responses You can configure a cache key and the Time to Live (TTL) of the API response Cached items are returned without calling the backend A cache is dedicated to you, by stage You can provision between 0.5GB to 237GB of cache
  • 26. Request processing workflow Receive incoming request • Check for item in dedicated cache • If found return cached item Check throttling configuration • Check current RPS rate • If above allowed rate return 429 Execute backend call
  • 27. Input / Output Transformation
  • 28. Input / Output Transforms Use Velocity Templates to transform data Filter output results • Remove private or unnecessary data • Filter dataset size to improve API performance GET to POST • Read all query string parameters from your GET request, and create a body to make a POST to your backend JSON to XML • Receive JSON input and transform it to XML for your backend • Receive JSON from a Lambda function and transform it to XML
  • 29. Transform Example: JSON to XML API Gateway Backend GET - /sayHello Lambda fn_sayHello /sayHello { “message” : “Hello world” } <xml> <message> Hello world </message> </xml> #set($root = $input.path('$')) <xml> <message> $root.message </message> </xml>
  • 30. For Loops and if Statements
  • 31. One Template per Content/Type
  • 33. API Models Models are a JSON Schema representation of your API requests and responses You can reuse models across multiple methods in your API Models are used to generate objects for the client SDK
  • 34. Generate Client SDKs Based on Your APIs SDKs are generated based on API deployments (Stages) If Request and Response Models are defined, the SDK includes input and output marshalling of your methods SDKs know how to handle throttling responses SDKs also know how to sign requests with AWS temporary credentials (SigV4) Support for Android, iOS, JavaScript, …
  • 35. Models are included in the SDK Models are generated using their name Nested items inherit the name of their parent model
  • 36. The Client SDK Declares All Methods