Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Sébastien Stormacq Technical Evangelist Amazon Web Service How Websites go Serverless? @sebsto sebsto

Slide 2

Slide 2 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential What is Serverless? Build and run applications without thinking about servers

Slide 3

Slide 3 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Evolving to Serverless SERVERLESS Virtual servers in the cloud Physical servers in datacenters Virtual servers in datacenters

Slide 4

Slide 4 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential No server is easier to manage than any server All of these responsibilities go away Provisioning and utilization Availability and fault tolerance Scaling Operations and management

Slide 5

Slide 5 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential What is serverless? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure

Slide 6

Slide 6 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Serverless applications FUNCTION SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state Node Python Java C# .Net Core 2.0 Go Ruby EVENT SOURCE

Slide 7

Slide 7 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Websites architecture

Slide 8

Slide 8 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Three-tier web application architecture https://d0.awsstatic.com/whitepapers/AWS_Serverless_Multi-Tier_Architectures.pdf Presentation Tier Logic Tier Data Tier Website Web Server Database

Slide 9

Slide 9 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Here is what that translates to in real life http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_web_01.pdf

Slide 10

Slide 10 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Serverless Website?

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Web application Data stored in Amazon DynamoDB Dynamic content from AWS Lambda

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Serverless web app security Permissions Bucket Policies ACLs Role Role Throttling Caching Usage Plans ACM Origin Access Identity (OAI) Geo-Restriction Signed Cookies Signed URLs DDOS Protection

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Custom Authorizers Lambda Function Lambda Function Custom Authorizer Cognito User Pool SAML Custom Authorizer Lambda function Two types: TOKEN - authorization token passed in a header REQUEST – all headers, query strings, paths, stage variables or context variables.

Slide 14

Slide 14 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Multi-Region with API Gateway AWS Cloud Regional API Endpoint us-east-1 Regional API Endpoint eu-west-1 api.mycorp.com CNAME CNAME

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential WebSockets support in Amazon API Gateway Real-time two-way communications Managed persistence Event-based triggers Mobile apps Chat Dashboards IoT devices Amazon API Gateway WebSockets API Stateful connection Stateless connection Lambda Functions Public Endpoints on Amazon EC2 Amazon Kinesis Any other AWS service All publicly accessible endpoints

Slide 16

Slide 16 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential http://bit.ly/ServerlessShop https://github.com/patrick-michelberger/serverless-shop

Slide 17

Slide 17 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Demo - http://notes.stormacq.com

Slide 18

Slide 18 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Serverless Website - demo JavaScript SDK Amazon API Gateway Amazon DynamoDB Static Files on S3 Amazon Cognito User Pool Amazon CloudFront

Slide 19

Slide 19 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Too complicated?

Slide 20

Slide 20 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential What is AWS Amplify? Open Source Developer Toolchain Command Line Interface (CLI) Client Framework UI Components Amplify Console

Slide 21

Slide 21 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential AWS Amplify Toolchain Categories Authentication Analytics API Storage Interactions

Slide 22

Slide 22 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential The AWS Amplify UI Components

Slide 23

Slide 23 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Getting Started – React Login in 5 min

Slide 24

Slide 24 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Download and set up Amplify CLI $ npm install -g @aws-amplify/cli $ amplify configure

Slide 25

Slide 25 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Bootstrap your preferred frontend setup, then … $ npm create react-app amplify-react-demo $ cd amplify-react-demo $ amplify init

Slide 26

Slide 26 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Add hosting (Production – S3 + CloudFront) $ amplify add hosting $ amplify publish $ amplify status Current Environment: prod | Category | Resource name | Operation | Provider plugin | | -------- | --------------- | --------- | ----------------- | | Hosting | S3AndCloudFront | No Change | awscloudformation | Hosting endpoint: https://d3i8d3iva3uhzp.cloudfront.net

Slide 27

Slide 27 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Add Amplify library to my App $ npm install aws-amplify $ npm install aws-amplify-react

Slide 28

Slide 28 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Add Authentication with Amazon Cognito $ amplify add auth $ amplify status Current Environment: prod | Category | Resource name | Operation | Provider plugin | | -------- | --------------- | --------- | ----------------- | | Auth | cognito65bfc0c5 | Create | awscloudformation | | Hosting | S3AndCloudFront | No Change | awscloudformation |

Slide 29

Slide 29 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css’; class App extends Component { render() { return (
… …
); } } export default App;

Slide 30

Slide 30 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import Amplify from 'aws-amplify’; import awsmobile from './aws-exports'; import { withAuthenticator } from 'aws-amplify-react'; Amplify.configure(awsmobile); class App extends Component { render() { return (
… …
); } } export default App;

Slide 31

Slide 31 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential AWS Amplify Console

Slide 32

Slide 32 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential AWS Amplify Console

Slide 33

Slide 33 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Where to start? https://aws.amazon.com/serverless/ https://aws.amazon.com/lambda/ https://aws-amplify.github.io/ https://aws-amplify.github.io/docs/js/react https://github.com/ziniman

Slide 34

Slide 34 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Today (Friday 17th) 10:30 AI & Machine Learning at Amazon 13:40 How web sites goes serverless? 15:40 How to build multi region application in the cloud? 17:20 Simplify your web and mobile apps with serverless backend in the cloud.

Slide 35

Slide 35 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Tomorrow (Saturday 18th) 10:30 Une introduction à AWS pour les développeurs 13:40 Utilisez des services d'intelligence artificielle dans vos applications sans être expert en apprentissage machine. 15:30 Hébergez votre site web sur AWS, en serverless et avec intégration continue.

Slide 36

Slide 36 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Sébastien Stormacq Technical Evangelist Amazon Web Service @sebsto sebsto Thank you !