SlideShare une entreprise Scribd logo
1  sur  43
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved
Introducing Amazon API Gateway
Vadim Zendejas – Partner Solutions Architect, AWS
vzendeja@amazon.lu
BARCELONA
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved
Agenda
• Why we built Amazon API Gateway
• What is Amazon API Gateway?
• Amazon API Gateway Features & Functionality
• Demo
API Proliferation
• The number of published APIs is growing rapidly
2418
10302
0
2000
4000
6000
8000
10000
12000
Jun-05
Oct-05
Feb-06
Jun-06
Oct-06
Feb-07
Jun-07
Oct-07
Feb-08
Jun-08
Oct-08
Feb-09
Jun-09
Oct-09
Feb-10
Jun-10
Oct-10
Feb-11
Jun-11
Oct-11
Feb-12
Jun-12
Oct-12
Feb-13
Jun-13
Oct-13
* Data from ProgrammableWeb
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
Your Feedback
• Managing multiple versions and stages of an API is difficult
• Monitoring 3rd party developers’ access is time consuming
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
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
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 /
Amazon
Elastic
Beanstalk
Any other publicly
accessible endpoint
Amazon
CloudWatch
Monitoring
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
• Provide API Gateway with a signed HTTPS certificate
• Custom domain names can point to an API or a Stage
• 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 & 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 to Authorize Access
• The name “Key” implies security – there is
no security in baking text in an App’s code
• 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
/login
Receives
credentials to
sign API calls
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 Models and Transforms
API Models
• Models are a JSON Schema representation of
your API requests and responses
• Models are used for input and output filtering,
and SDK generation
• You can reuse models across multiple methods
in your API
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>
SDK Generation
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, …
Demo
Demo
/helloworld
GET
POST
API
Gateway
AWS Lambda
functions
API
Gateway
GetHelloWorld
GetHelloWorldUser
{"Hello": "World"}
{"Hello": "Barcelona!"}
Amazon
CloudWatch
Monitoring
Demo
/helloworld
GET
POST
API
Gateway
AWS Lambda
functions
API
Gateway
GetHelloWorld
GetHelloWorldUser
{"Hello": "World"}
{"Hello": "Barcelona!"}
Amazon
CloudWatch
Monitoring
Serverless API!
Amazon API Gateway Pricing
• $3.50 per Million API Gateway requests
• Included in the AWS Free Tier
– 1 Million API requests per month for 12 months
• Data Transfer Out (Standard AWS Prices)
– $0.09/GB for the first 10 TB
– $0.085/GB for the next 40 TB
– $0.07/GB for the next 100 TB
– $0.05/GB for the next 350 TB
Optional – Dedicated Cache Pricing
Cache Memory
Size (GB)
Price per Hour
(USD)
0.5 $0.020
1.6 $0.038
6 $0.200
13 $0.250
28 $0.500
58 $1.000
118 $1.900
237 $3.800
Availability
• Today!
• Initially available in:
– US East (N. Virginia)
– US West (Oregon)
– EU West (Dublin)
– AP North East (Tokyo)
– Plan to enable other regions rapidly
Amazon API Gateway
Build, Deploy & Manage your APIs
http://aws.amazon.com/apigateway/
BARCELONA
BARCELONA
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

Contenu connexe

Tendances

Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for StartupsMark Bate
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API GatewayAmazon Web Services
 
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 TogetherDanilo Poccia
 
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 ...Amazon Web Services
 
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
 
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 GatewayAmazon Web Services
 
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 GatewayDanilo Poccia
 
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 GatewaySteve Androulakis
 
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 Lambdadevopsdaysaustin
 
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...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 GatewayAmazon 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 GatewayAmazon Web Services
 
Building Serverless Web Applications - May 2017 AWS Online Tech Talks
Building Serverless Web Applications  - May 2017 AWS Online Tech TalksBuilding Serverless Web Applications  - May 2017 AWS Online Tech Talks
Building Serverless Web Applications - May 2017 AWS Online Tech TalksAmazon Web Services
 
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 LambdaAmazon Web Services
 
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar Series
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar SeriesDeep Dive on Serverless Web Applications - AWS May 2016 Webinar Series
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar SeriesAmazon Web Services
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018Yoel Spotts
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 

Tendances (20)

Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for Startups
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
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 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 ...
 
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...
 
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
 
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
 
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
 
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
 
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
 
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
 
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
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
Building Serverless Web Applications - May 2017 AWS Online Tech Talks
Building Serverless Web Applications  - May 2017 AWS Online Tech TalksBuilding Serverless Web Applications  - May 2017 AWS Online Tech Talks
Building Serverless Web Applications - May 2017 AWS Online Tech Talks
 
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 API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar Series
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar SeriesDeep Dive on Serverless Web Applications - AWS May 2016 Webinar Series
Deep Dive on Serverless Web Applications - AWS May 2016 Webinar Series
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 

Similaire à AWS Summit Barcelona 2015 - Introducing Amazon API Gateway

以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端Amazon Web Services
 
AWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless RecapAWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless RecapDaniel Zivkovic
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017ARDC
 
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...Joe Levy
 
Getting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless ComputingGetting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless ComputingAmazon Web Services
 
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 RideAmazon Web Services
 
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 RideAmazon Web Services
 
(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 APIsAmazon Web Services
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...Amazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
Serverless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversServerless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversAmazon Web Services
 
RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)Cisco DevNet
 
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
 
Get An Attractive Score in AWS Developer Associate (DVA-C02) Exam
Get An Attractive Score in AWS Developer Associate (DVA-C02) ExamGet An Attractive Score in AWS Developer Associate (DVA-C02) Exam
Get An Attractive Score in AWS Developer Associate (DVA-C02) ExamAdinaCoyle
 

Similaire à AWS Summit Barcelona 2015 - Introducing Amazon API Gateway (20)

Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端以AWS Lambda與Amazon API Gateway打造無伺服器後端
以AWS Lambda與Amazon API Gateway打造無伺服器後端
 
Operating Your Production API
Operating Your Production APIOperating Your Production API
Operating Your Production API
 
AWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless RecapAWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless Recap
 
Managing Your Cloud Assets
Managing Your Cloud AssetsManaging Your Cloud Assets
Managing Your Cloud Assets
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
 
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
API City 2019 Presentation - Delivering Developer Tools at Scale: Microsoft A...
 
Getting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless ComputingGetting Started with AWS Lambda & Serverless Computing
Getting Started with AWS Lambda & Serverless Computing
 
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
 
(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
 
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
SRV418 Deep Dive on Accelerating Content, APIs, and Applications with Amazon ...
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Open Banking & Open Insurance
Open Banking & Open InsuranceOpen Banking & Open Insurance
Open Banking & Open Insurance
 
Serverless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversServerless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about servers
 
RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)RESTful web APIs (build, document, manage)
RESTful web APIs (build, document, manage)
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Get An Attractive Score in AWS Developer Associate (DVA-C02) Exam
Get An Attractive Score in AWS Developer Associate (DVA-C02) ExamGet An Attractive Score in AWS Developer Associate (DVA-C02) Exam
Get An Attractive Score in AWS Developer Associate (DVA-C02) Exam
 

Plus de Vadim Zendejas

Scalable Web Applications in AWS, 2014
Scalable Web Applications in AWS, 2014Scalable Web Applications in AWS, 2014
Scalable Web Applications in AWS, 2014Vadim Zendejas
 
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...Vadim Zendejas
 
Gitex Dubai 2015 - Accelerate your Innovation with AWS
Gitex Dubai 2015 - Accelerate your Innovation with AWSGitex Dubai 2015 - Accelerate your Innovation with AWS
Gitex Dubai 2015 - Accelerate your Innovation with AWSVadim Zendejas
 
AWS The Enterprise Cloud 2015
AWS The Enterprise Cloud 2015AWS The Enterprise Cloud 2015
AWS The Enterprise Cloud 2015Vadim Zendejas
 
Kubernetes Fundamentals on Azure 2017
Kubernetes Fundamentals on Azure 2017Kubernetes Fundamentals on Azure 2017
Kubernetes Fundamentals on Azure 2017Vadim Zendejas
 
Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Vadim Zendejas
 
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...Vadim Zendejas
 
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital Innovation
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital InnovationRed Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital Innovation
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital InnovationVadim Zendejas
 

Plus de Vadim Zendejas (8)

Scalable Web Applications in AWS, 2014
Scalable Web Applications in AWS, 2014Scalable Web Applications in AWS, 2014
Scalable Web Applications in AWS, 2014
 
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
CuriousMinds and Siemens in Brasov 2015 - Building and Developing for the Clo...
 
Gitex Dubai 2015 - Accelerate your Innovation with AWS
Gitex Dubai 2015 - Accelerate your Innovation with AWSGitex Dubai 2015 - Accelerate your Innovation with AWS
Gitex Dubai 2015 - Accelerate your Innovation with AWS
 
AWS The Enterprise Cloud 2015
AWS The Enterprise Cloud 2015AWS The Enterprise Cloud 2015
AWS The Enterprise Cloud 2015
 
Kubernetes Fundamentals on Azure 2017
Kubernetes Fundamentals on Azure 2017Kubernetes Fundamentals on Azure 2017
Kubernetes Fundamentals on Azure 2017
 
Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017
 
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
 
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital Innovation
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital InnovationRed Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital Innovation
Red Hat Forum Norway 2017 - Red Hat on Azure Partners in Digital Innovation
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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 Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Dernier (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

AWS Summit Barcelona 2015 - Introducing Amazon API Gateway

  • 1. ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved Introducing Amazon API Gateway Vadim Zendejas – Partner Solutions Architect, AWS vzendeja@amazon.lu
  • 2. BARCELONA ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved
  • 3. Agenda • Why we built Amazon API Gateway • What is Amazon API Gateway? • Amazon API Gateway Features & Functionality • Demo
  • 4. API Proliferation • The number of published APIs is growing rapidly 2418 10302 0 2000 4000 6000 8000 10000 12000 Jun-05 Oct-05 Feb-06 Jun-06 Oct-06 Feb-07 Jun-07 Oct-07 Feb-08 Jun-08 Oct-08 Feb-09 Jun-09 Oct-09 Feb-10 Jun-10 Oct-10 Feb-11 Jun-11 Oct-11 Feb-12 Jun-12 Oct-12 Feb-13 Jun-13 Oct-13 * Data from ProgrammableWeb
  • 5. At AWS, We run a lot of APIs …Over time, we have learned a few lessons
  • 6. Your Feedback • Managing multiple versions and stages of an API is difficult
  • 7. Your Feedback • Managing multiple versions and stages of an API is difficult • Monitoring 3rd party developers’ access is time consuming
  • 8. 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
  • 9. 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
  • 10. 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?
  • 11. • 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
  • 12. 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
  • 13. How Does Amazon API Gateway Work?
  • 14. An API Call Flow Internet Mobile Apps Websites Services API Gateway AWS Lambda functions AWS API Gateway Cache Endpoints on Amazon EC2 / Amazon Elastic Beanstalk Any other publicly accessible endpoint Amazon CloudWatch Monitoring
  • 15. 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
  • 16. 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
  • 17. 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
  • 18. Manage Multiple Versions and Stages of your APIs API 1 (v1) Stage (dev) Stage (prod) API 2 (v2) Stage (dev)
  • 19. Custom Domain Names • You can configure custom domain names • Provide API Gateway with a signed HTTPS certificate • Custom domain names can point to an API or a Stage • 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/)
  • 21. 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
  • 22. API Keys to Authorize Access • The name “Key” implies security – there is no security in baking text in an App’s code • API Keys should be used purely to meter app/developer usage • API Keys should be used alongside a stronger authorization mechanism
  • 23. 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
  • 24. 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 /login Receives credentials to sign API calls
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. Input / Output Models and Transforms
  • 30. API Models • Models are a JSON Schema representation of your API requests and responses • Models are used for input and output filtering, and SDK generation • You can reuse models across multiple methods in your API
  • 31. 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
  • 32. 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>
  • 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. Demo
  • 38. Amazon API Gateway Pricing • $3.50 per Million API Gateway requests • Included in the AWS Free Tier – 1 Million API requests per month for 12 months • Data Transfer Out (Standard AWS Prices) – $0.09/GB for the first 10 TB – $0.085/GB for the next 40 TB – $0.07/GB for the next 100 TB – $0.05/GB for the next 350 TB
  • 39. Optional – Dedicated Cache Pricing Cache Memory Size (GB) Price per Hour (USD) 0.5 $0.020 1.6 $0.038 6 $0.200 13 $0.250 28 $0.500 58 $1.000 118 $1.900 237 $3.800
  • 40. Availability • Today! • Initially available in: – US East (N. Virginia) – US West (Oregon) – EU West (Dublin) – AP North East (Tokyo) – Plan to enable other regions rapidly
  • 41. Amazon API Gateway Build, Deploy & Manage your APIs http://aws.amazon.com/apigateway/
  • 43. BARCELONA ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

Notes de l'éditeur

  1. First understand what has driven the decision to build API Gateway, from customer feedback to wider strategic decisions and market forces Next, look at how the service works, and helps customers with their API services Finally, open it out for Q&A at the end
  2. Over the past few years the number of APIs published on the internet has grown at an increasing pace AWS customers have been at the epicenter of this, building APIs on our infrastructure offerings AWS itself was one of the first companies to offer APIs for developers to interact with its services, this created the DevOps market Looking at market data from ProgrammableWeb, and talking to our customers, it is apparent that what we see documented on the public internet is only the tip of the iceberg Both startups and corporations are adopting a service oriented architecture and creating internal, hidden APIs to decouple their system architecture.
  3. At AWS we have some experience building scalable, reliable APIs These are just a few logos but all of our services expose APIs for developers to interact with them In fact, if they wanted to developers wouldn’t have to use the management console at all, and could simply rely on our APIs to automate their workflow
  4. Just like all other AWS services, we started this process by talking to our customers. This is what they told us Very often APIs are built and deployed quickly, one month down the line customers find themselves looking for a way to version and monitor the APIs, something they had not thought about
  5. After an API is published, and has become successful, the next challenge facing our customers is how to manage, monitor and monetize the ecosystem of 3rd party developers utilizing their APIs
  6. Authorization, and auth in general, is a hard task. It’s complex to build and often repetitive work – our customers are reinventing the wheel each time they start a new project.
  7. Managing traffic and operating a reliable network that can protect endpoints against attack is very hard and requires significant investment in terms of equipment, initial setup, and ongoing operation maintenance.
  8. Finally, we have an entire new generation of developers adopting AWS. At the forefront of this are mobile developers, who are entirely focused on their end-user experience to succeed in a very competitive market and not interested in building or managing the required, complex infrastructure, and they shouldn’t have to.
  9. Based on the feedback we received from our customers we worked on a new product, Amazon API Gateway. The ability to create and run multiple version of an API simultaneously. We have also built Stages. These enable developers to deploy multiple stages of each version simultaneously. For example, dev stage, prod stage, or beta stage. API Gateway helps developers create, monitor, and manage API Keys that they can distribute to 3rd party developers Developers who already own an authentication and authorization system can leverage their own infrastructure. For developers who are starting from scratch we have introduced the ability to leverage AWS’ own authorization mechanisms such as Signature V4 on Requests and IAM access policies for fine-grained access control At AWS we already run a very large, reliable network. API Gateway helps developers leverage all the work we have done over the years and allows developers to throttle incoming requests and use CloudWatch to monitor the status and latency of their APIs and set Alarms. Finally, it turns out AWS already had the perfect tool for developers who wanted to build server-less backends, it’s AWS Lambda. With the API Gateway customers can now expose AWS Lambda functions as API endpoints.
  10. And beyond this, we’ve listened and included additional features such as… Customers will be able to provision and configure a dedicated cache for their APIs, we will serve responses from the cache without hitting a customer’s backend whenever possible Continuing our story on leveraging the powerful network AWS has built, API Gateway leverages Amazon CloudFront to create global distributions for customer’s APIs, this lowers the latency for end users but also gives our customers’ APIs DDoS protection out of the box, both for malicious requests (Layer 7) and for lower level attacks (Layer 3, SYN floods) API Gateway can automatically generate client SDKs based on our customer’s API definition. This allows developers to take their APIs from concept to integration test in a client app in a matter of hours, now weeks Many of our customers use Swagger to define their APIs. API Gateway can import Swagger definitions. We have also built an open source Swagger import tool that our customers can use as part of their development workflow. This way they can keep working with Swagger in their local repository, then import and deploy their APIs into API Gateway at build time We have also integrated with the Apache Velocity templating engine, this allows our customers to transform the shape of requests and responses as they flow through the API Gateway. This gives customers the ability to expose legacy endpoints as modern, RESTful APIs among many other things.
  11. The first thing we want to look at is the standard flow of an API call, including all components in the system First, a request comes in from a client, this could be a mobile device, a web application or a backend service The requests arrives at one of our CloudFront PoP locations, it’s accepted and routed through to the API Gateway in the customer’s region The API Gateway receives the request, then checks for records in the dedicated cache (if it is configured). If there are no cached records available then it will forward the request to the backend for processing The backend can be a Lambda function, a web service running on Amazon EC2, or any other publicly accessible web service Once the backend has processed the request the API call metrics are logged in Amazon CloudWatch and the content is returned to the client
  12. Let’s look at what is an API, how you build, and how you deploy an API The first step is to create a new API, and declare its resources and methods. Once an API is declared it can be tested from the Console or the API Gateway APIs, but it is not yet accessible on the internet To make the API available it needs to be deployed to a Stage. Stages help you manage your development, beta, production environments etc. Customers can create as many stages as they want, similar to tagging. Each stage can be configured with its own logging, throttling, monitoring and caching settings At any time you can clone the state of an existing API into a new one, this allows you to start working on v2 of your APIs while v1 is still being developed/fixed. API Gateway saves a history of the last 300 deployments to each stage, at any time you can point a Stage (for example production) to a different deployment
  13. Let’s look in details at the hierarchical structure of an API The top level element is the API itself, we call it a REST API. A rest API can contain many resources, resources are typed objects that are part of your API’s domain. They also represent the path through which the objects will be accessible You can nest resources, in our example the /pet/{petId} represents an individual pet and is a nested resource of the /pets/ resource. Each resource can declare methods. Methods are the combination of a resource + an HTTP Verb. We support 7 standard HTTP Verbs, For example, a method is the POST to the /pets/{petId} resources – this would be used to create a new pet
  14. Now that we have declared an API with its resources and methods, we can deploy it to make it accessible to 3rd party developers APIs are deployed to a Stage Stages represent environments, for example development of production In API Gateway Stages are like tags, and developers can create as many stages as they want. A stage is just an alphanumeric string Stages are part of the path that will be used to reach sources and methods, for example the prod stage will be available at execute-api.apigateway.com/stage/resource
  15. This is a visual representation of how versions and stages are managed by the API Gateway, and how customers can leverage these features for their APIs The first thing we’ll do is declared a V1 API and start configuring its resources and methods The next step is to deploy the API to a development stage, we’ll keep deploying to development as we evolve our API At a certain point, when we are ready for 3rd party developers to access this API, we will publish it to a production stage and distribute API Keys and generated SDKs All along we will keep deploying APIs to both dev and prod including new features and bug fixed Eventually we’ll want to make some breaking changes, and work on a much improved v2 API. However, we cannot make breaking changes to the API in production because we have thousands of developers using it. To manage this situation we’ll simply clone the current state of the v1 API into a new API called v2, and begin development of the new version By cloning we can keep publishing bug fixes to the first release and supporting users that are calling it with a gentle, gradual deprecation “… developers feel like they can deliver what they want, when they want to – and that makes for an extremely valuable tool …”
  16. Customers can configure the API Gateway to use a custom domain name they provide instead of the standard AWS domain. We expect customers to bring their own signed certificate for the HTTPS endpoints Domain names can be configured to point to an API, our top level item, or directly to a specific stage within an API. Pointing a custom domain name to an API requires the stage to be included in the path If the domain name is pointed directly at a stage there is no need for the path variable, resources can be accessed directly form the API root “/”
  17. API Keys are a great tool to manage the community of 3rd party developers interacting with the APIs API Gateway allows customers to create API Keys through a console interface or through an API for programmatic creation. Customers can set permissions on API Keys and allow access only to a set of APIs, or stages within an API Calls made by an API Key are logged in CloudWatch so that customers can always track utilization by 3rd party developers
  18. We always get asked whether API Keys are the authorization mechanism for APIs, so we’ll just be upfront: NO, at least we don’t recommend it We strongly encourage customers to use a temporary tokens based on a successful user authentication, either by leveraging AWS temporary credentials through API Signature Version 4, or their own Oauth mechanism
  19. AWS gives customers the ability to retrieve temporary, limited privilege credentials that are tied to an IAM role within their AWS account through services like Cognito and STS. Based on these credentials developers can sign calls to the APIs, the generated client SDKs automatically know how to handle these credentials In the next slide we’ll go through a real-world use-case for this Alternatively customers can setup the API Gateway to forward their existing headers to keep using their current OAuth authorization schema
  20. We’ll go through a use case that leverage AWS Lambda and Amazon Cognito to retrieve temporary credentials for a particular end user and authorize access to the APIs As discussed before the API Gateway helps customers leverage AWS Sigv4 – only one open API is required and then we can verify signatures on all other calls.
  21. API Gateway uses throttling to help protect customer backends and send only request that they can handle To implement throttling we use the token bucket algorithm Customers can set the number of RPS calls they know their backend can handle, and a rate at which the bucket is refilled
  22. To limit the number of requests their backend can receive, and further bring down latency customers can configure a dedicated cache for each stage of their API For each method in their APIs customers can configure which parameters between path, query string and headers form the item key in the cache, and assign each item a time to live API Gateway automatically caches responses where configured and avoids calling the customer’s backend if the cached item is available and valid Customers have access to APIs to manage their cache in the API Gateway When a stage is configured with a dedicated cache, and an item is found to be in cache and valid for a request that would otherwise be throttled, the API Gateway will handle the request and return the cached response Customers can pick for a range of possible cache sizes to provision a dedicated cache from their stage, from 0.5GB all the way up to 237GB
  23. Let’s put the two together and look at the execution path of an API call First, when we receive a request, we will check the dedicated cache (if it’s been configured) If we have an item in the cache then we can handle the request regardless of the throttling configuration, it will have no effect on our customer’s backend Next, if we don’t have a cache, we check the throttling configuration and the current throttling state (our bucket) If we are above the limit we will return a 429 response Otherwise we will execute the backend call and return the result As we mentioned our generated SDKs automatically know how to handle throttling responses, and they will perform an exponential backoff while retrying the call
  24. API Gateway handles resources as typed objects. Resources can have models associated with them. Models are simply the JSON schema representation of the request and response data models If the API Gateway is aware of the request and response models it can Generate SDKs that include actual objects for each request and response rather than generic (JSON Object) Allow JSON traversal of requests and responses in the data transformation engine
  25. Let’s look at how request and response data can be transformed in-flight. We use Apache Velocity as the standard to create, save and execute templates We have been working with our customers on this and during development we have seen the following use-cases from them Filter API responses. In many cases legacy APIs tended to return verbose responses with too many objects. Large payloads are a struggle for mobile applications, so customers are using the templates to traverse the response schema and filter the output to return only the necessary fields RPC to REST. Customers have RPC-style APIs that they wanted to expose to the world in the form of RESTful APIs. RPC often only accept POST calls. Customers used the transform templates to accept a GET call in the API Gateway, then generate the POST body for their backend call reading parameters from the path, query string and headers Customers who want to leverage Lambda but only run XML APIs have been using the transform templates to receive the JSON output from Lambda, and turn it into an XML before sending it back to the end user. This has allowed them to completely switch their backend technology while causing no disruption for 3rd party developers utilizing their APIs, very neat tablecloth trick. Example: Twilio
  26. Example of a simple transformation flow API Gateway + Lambda = Server-less backend Use AWS Lambda to run business logic Use API Gateway to expose the AWS Lambda functions as endpoints Transforms Lambda’s JSON output to XML for their APIs
  27. API Gateway can generate client SDKs based on a customer’s API definition. Simply select the deployment the SDK should target, the platform, and setup a couple of parameters and the API Gateway generates an SDK and makes it available to download through an API or the management console SDK are model-aware and also come with the built-in AWS core that allows them to handle throttling responses and sign requests using AWS Credentials
  28. We will create an API that uses as a backend a Lambda function The “Hello World” API will have two methods: GET and POST Each method will be mapped to a different Lambda function When you request the “/helloworld” API the Lambda function will be executed and the function will return the response We are using a very simple node.js function And we will be able to monitor execution of our API trough CloudWatch
  29. - We created a totally serverless API application in minutes (very simple one).
  30. Build, Deploy & Manage your APIs Request & Response Transform support Secure access using Sigv4 or OAuth Protect your backend with Throttling & Caching Simplified Client access via SDK Generation Usage-based pricing