SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
Build a Serverless Backend for Requesting a Ride
Speaker Name,
Speaker Title
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Scenario: Serverless Backend
Our users are now signing up to
our service. It’s time to get our
unicorns working. Produce a
backend for our service. Just be
aware we are expecting a huge
turnout on day 1, so make sure
we scale to handle demand!
Giddy Up!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
The AWS Serverless Platform from A to Z
An Introduction to Amazon API Gateway and AWS Lambda
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
In the beginning…
Physical Hardware – time to value = Months
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon Elastic Compute Cloud (EC2)
• Allows developers to
obtain compute capacity
on-demand
• Create virtual servers in
the cloud with the click of
a button
Virtual Machines – time to value = Days
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon Elastic Container Service (ECS)
• Allows developers to
obtain compute capacity
on-demand
• Create containers at the
press of a button
Containers – time to value = Hours
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
The evolution of backend computing
Serverless
Containers
Virtualization
Hardware
More time on code
More time on infrastucture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless Computing
• Fully Managed
§ No provisioning
§ No security patches
§ Fault tolerant
• Continuous Scaling
§ Scales up and down with demand
§ Never pay for idle resources
• Developer Productivity
§ Focus on your application
§ Experiment and innovate quickly
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Lambda: Serverless computing
• Run code without servers. Pay only for the compute time you consume.
• Triggered by events or called from APIs:
§ PUT to an Amazon S3 bucket
§ Updates to Amazon DynamoDB table
§ Call to an Amazon API Gateway endpoint
§ Mobile app back-end call
§ And many more…
• Makes it easy to:
§ Perform real-time data processing
§ Build scalable back-end services
§ Glue and choreograph systems
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Benefits of AWS Lambda
No Servers to Manage Continuous Scaling Don’t Pay for Idle Resources
Lambda allows you to run
application logic without
provisioning servers or worrying
about the health or security of
underlying resources
Lambda scales infrastructure
beneath your application logic;
just send requests and events
and Lambda will automatically
scale to accommodate it
With Lambda, you’re billed in
100ms increments of execution
time and number of requests and
you’re never charged for anything
when your code isn’t running
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon DynamoDB
• Fast and flexible NoSQL database service for any scale
Simple to use
• GetItem(primaryKey)
• PutItem(item)
Robust Depth
• Fine-Grained Access Control
• Streams
• Triggers
• Cross-Region Replication
• DynamoDB local
• Free-text search
• Titan Graph Database integration
• Strong consistency option
• Atomic counters
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon API Gateway
• Create, publish, maintain, monitor, and secure APIs at any scale
Create a unified API
frontend for multiple
backend microservices
DDoS and throttling to
protect your backend
microservices
Authenticate and authorize
requests to your backend
microservices
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Workshop: Integrating A Serverless Backend
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Wild Rydes Architecture
AWS cloud
Amazon S3
bucket
CloudFront
distribution
Amazon Cognito
Amazon API
Gateway
Lambda function Amazon
DynamoDB
Cloud Logic makes developing
HTTP endpoints easy
• Write your code in JavaScript
• Link resources easily
• Upload with awsmobile
• Access with AWS Amplify
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What we are going to do:
1. Create a NoSQL Database for our backend
2. Create some HTTP endpoints to handle business logic
3. Write code in our web application to call the HTTP endpoints
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Step 1: Create a DynamoDB Table
• Open the AWS Mobile Hub Console.
• Choose your project.
• Choose NoSQL Database from the list of additional backend features.
• Choose Enable NoSQL, then Create Table.
• Create a Custom table.
• Fill in the form:
– Table name: Rides.
– Permissions: Public.
– Attribute: RideId (String, Partition Key)
• Choose Create table (and again)
• In your command line, execute awsmobile pull
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Step 2: Create a HTTP Endpoint
• Run awsmobile cloud-api enable --prompt
– Create a new API
– API Name: requestUnicorn
– Restrict API Access to signed-in users? Y
– HTTP Path Name: /ride
– Lambda Function Name: requestUnicorn
– Add another HTTP path name? N
• Copy server/requestUnicorn.js to
awsmobilejs/backend/cloud-api/requestUnicorn/app.js
• Run awsmobile push
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Step 3: Add code to client
• Edit src/pages/MainApp.js
• Adjust the getData() method:
async getData(pin) {
const body = {
PickupLocation: {
Longitude: pin.longitude,
Latitude: pin.latitude
}
};
return await API.post(apiName, apiPath, { body });
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Step 4: Try the completed app
• Run awsmobile publish to publish your content to the web
• Open browser to your S3 location
• Click ‘Giddy Up!’ on the home page
• Sign in
• Click a location on the map to set the PIN
• Click Request to request your unicorn
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Congratulations!
We’ve made an awesome web
experience that our users can use
to request a Unicorn.
However, you aren’t always in
front of a web browser when you
need your unicorn. Perhaps a
mobile app is a good idea.
But that’s a problem for tomorrow
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
aws.amazon.com/mobile
@AWSforMobile
Everything you need to connect
Your mobile app to the cloud

More Related Content

What's hot

Building Global Serverless Backends powered by Amazon DynamoDB Global Tables
Building Global Serverless Backends powered by Amazon DynamoDB Global TablesBuilding Global Serverless Backends powered by Amazon DynamoDB Global Tables
Building Global Serverless Backends powered by Amazon DynamoDB Global Tables
Amazon Web Services
 

What's hot (20)

Invite your prospects with an engaging email campaign
Invite your prospects with an engaging email campaignInvite your prospects with an engaging email campaign
Invite your prospects with an engaging email campaign
 
Building Mobile Apps with AWS Amplify
Building Mobile Apps with AWS AmplifyBuilding Mobile Apps with AWS Amplify
Building Mobile Apps with AWS Amplify
 
Building Mobile Apps with AWS Amplify
Building Mobile Apps with AWS AmplifyBuilding Mobile Apps with AWS Amplify
Building Mobile Apps with AWS Amplify
 
Introduction to Development for Mobile with AWS
Introduction to Development for Mobile with AWSIntroduction to Development for Mobile with AWS
Introduction to Development for Mobile with AWS
 
Serverless - State of the Union
Serverless - State of the UnionServerless - State of the Union
Serverless - State of the Union
 
Containers - State of the Union
Containers - State of the UnionContainers - State of the Union
Containers - State of the Union
 
Module 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-APIModule 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-API
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Building Global Serverless Backends powered by Amazon DynamoDB Global Tables
Building Global Serverless Backends powered by Amazon DynamoDB Global TablesBuilding Global Serverless Backends powered by Amazon DynamoDB Global Tables
Building Global Serverless Backends powered by Amazon DynamoDB Global Tables
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDK
 
re:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Servicesre:Invent 2018: AI/ML Services
re:Invent 2018: AI/ML Services
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Introduction to AWS Amplify CLI
Introduction to AWS Amplify CLIIntroduction to AWS Amplify CLI
Introduction to AWS Amplify CLI
 
Introduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLIntroduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQL
 
Introduction to Microsoft Workloads on AWS - AWS Online Tech Talks
Introduction to Microsoft Workloads on AWS - AWS Online Tech TalksIntroduction to Microsoft Workloads on AWS - AWS Online Tech Talks
Introduction to Microsoft Workloads on AWS - AWS Online Tech Talks
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
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 your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSyncBuilding your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSync
 
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 

Similar to Build a Serverless Backend for Requesting a Ride

How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
Amazon Web Services
 

Similar to Build a Serverless Backend for Requesting a Ride (20)

Build a Serverless Web Application in One Day
Build a Serverless Web Application in One DayBuild a Serverless Web Application in One Day
Build a Serverless Web Application in One Day
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless Architecture
 
AWS Serverless Development
AWS Serverless DevelopmentAWS Serverless Development
AWS Serverless Development
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWS
 
GPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to MoveGPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWS
 
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
SRV331_Build a Multi-Region Serverless Application for Resilience and High Av...
 
Serverless DevOps to the Rescue
Serverless DevOps to the RescueServerless DevOps to the Rescue
Serverless DevOps to the Rescue
 
Create a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformCreate a Serverless Image Processing Platform
Create a Serverless Image Processing Platform
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
 
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
 
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
 
Building secure and scalable mobile applications on AWS - AWS Summit Cape Tow...
Building secure and scalable mobile applications on AWS - AWS Summit Cape Tow...Building secure and scalable mobile applications on AWS - AWS Summit Cape Tow...
Building secure and scalable mobile applications on AWS - AWS Summit Cape Tow...
 
Wildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel AvivWildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel Aviv
 
Building Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech TalksBuilding Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech Talks
 
React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 

More from Amazon Web Services

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

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
 

Build a Serverless Backend for Requesting a Ride

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft Build a Serverless Backend for Requesting a Ride Speaker Name, Speaker Title
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Scenario: Serverless Backend Our users are now signing up to our service. It’s time to get our unicorns working. Produce a backend for our service. Just be aware we are expecting a huge turnout on day 1, so make sure we scale to handle demand! Giddy Up!
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved The AWS Serverless Platform from A to Z An Introduction to Amazon API Gateway and AWS Lambda
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved In the beginning… Physical Hardware – time to value = Months
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon Elastic Compute Cloud (EC2) • Allows developers to obtain compute capacity on-demand • Create virtual servers in the cloud with the click of a button Virtual Machines – time to value = Days
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon Elastic Container Service (ECS) • Allows developers to obtain compute capacity on-demand • Create containers at the press of a button Containers – time to value = Hours
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved The evolution of backend computing Serverless Containers Virtualization Hardware More time on code More time on infrastucture
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless Computing • Fully Managed § No provisioning § No security patches § Fault tolerant • Continuous Scaling § Scales up and down with demand § Never pay for idle resources • Developer Productivity § Focus on your application § Experiment and innovate quickly
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Lambda: Serverless computing • Run code without servers. Pay only for the compute time you consume. • Triggered by events or called from APIs: § PUT to an Amazon S3 bucket § Updates to Amazon DynamoDB table § Call to an Amazon API Gateway endpoint § Mobile app back-end call § And many more… • Makes it easy to: § Perform real-time data processing § Build scalable back-end services § Glue and choreograph systems
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Benefits of AWS Lambda No Servers to Manage Continuous Scaling Don’t Pay for Idle Resources Lambda allows you to run application logic without provisioning servers or worrying about the health or security of underlying resources Lambda scales infrastructure beneath your application logic; just send requests and events and Lambda will automatically scale to accommodate it With Lambda, you’re billed in 100ms increments of execution time and number of requests and you’re never charged for anything when your code isn’t running
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon DynamoDB • Fast and flexible NoSQL database service for any scale Simple to use • GetItem(primaryKey) • PutItem(item) Robust Depth • Fine-Grained Access Control • Streams • Triggers • Cross-Region Replication • DynamoDB local • Free-text search • Titan Graph Database integration • Strong consistency option • Atomic counters
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon API Gateway • Create, publish, maintain, monitor, and secure APIs at any scale Create a unified API frontend for multiple backend microservices DDoS and throttling to protect your backend microservices Authenticate and authorize requests to your backend microservices
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Workshop: Integrating A Serverless Backend
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Wild Rydes Architecture AWS cloud Amazon S3 bucket CloudFront distribution Amazon Cognito Amazon API Gateway Lambda function Amazon DynamoDB Cloud Logic makes developing HTTP endpoints easy • Write your code in JavaScript • Link resources easily • Upload with awsmobile • Access with AWS Amplify
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved What we are going to do: 1. Create a NoSQL Database for our backend 2. Create some HTTP endpoints to handle business logic 3. Write code in our web application to call the HTTP endpoints
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Step 1: Create a DynamoDB Table • Open the AWS Mobile Hub Console. • Choose your project. • Choose NoSQL Database from the list of additional backend features. • Choose Enable NoSQL, then Create Table. • Create a Custom table. • Fill in the form: – Table name: Rides. – Permissions: Public. – Attribute: RideId (String, Partition Key) • Choose Create table (and again) • In your command line, execute awsmobile pull
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Step 2: Create a HTTP Endpoint • Run awsmobile cloud-api enable --prompt – Create a new API – API Name: requestUnicorn – Restrict API Access to signed-in users? Y – HTTP Path Name: /ride – Lambda Function Name: requestUnicorn – Add another HTTP path name? N • Copy server/requestUnicorn.js to awsmobilejs/backend/cloud-api/requestUnicorn/app.js • Run awsmobile push
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Step 3: Add code to client • Edit src/pages/MainApp.js • Adjust the getData() method: async getData(pin) { const body = { PickupLocation: { Longitude: pin.longitude, Latitude: pin.latitude } }; return await API.post(apiName, apiPath, { body }); }
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Step 4: Try the completed app • Run awsmobile publish to publish your content to the web • Open browser to your S3 location • Click ‘Giddy Up!’ on the home page • Sign in • Click a location on the map to set the PIN • Click Request to request your unicorn
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Congratulations! We’ve made an awesome web experience that our users can use to request a Unicorn. However, you aren’t always in front of a web browser when you need your unicorn. Perhaps a mobile app is a good idea. But that’s a problem for tomorrow
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft aws.amazon.com/mobile @AWSforMobile Everything you need to connect Your mobile app to the cloud