s u m m i t - amazon web services... · 2019-04-04 · simplifier vos frontends à l’aidede...

65
SUMMIT Paris

Upload: others

Post on 16-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

S U MM I TP a r i s

Page 2: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMM IT

Simplifier vos frontends à l’aide de backends serverless dans le cloud

M A P 3 0 2

Sébastien Stormacq

Technical Evangelist, AWS EMEA

@ sebsto

Aurélien Capdecomme

CTO, 20 Minutes

@ menthefraiche

Page 3: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Une nouvelle journée dans la vie d’un développeur

Page 4: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Nous avons besoin d’une app pour que nos clients puissent mettre à

jour leurs préférences. Notre concurrent vient de lancer la sienne.

Nous en avons besoin rapidement. Je n’ai pas de budget, surtout

qu’on ne sait pas si on aura du succès ou pas. Je ne veux pas payer si

ca ne marche pas. Elle doit pouvoir s’accomoder de millions

d’utilisateurs, être facile à maintenir et gérer au quotidien. Et tu es

tout seul sur ce projet, désolé.

Une nouvelle journée dans la vie d’un développeur

Page 5: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Une nouvelle journée dans la vie d’un développeur

Nous avons besoin d’une app pour que nos clients puissent mettre à

jour leurs preferences. Notre concurrent vient de lancer la sienne.

Nous en avons besoin rapidement. Je n’ai pas de budget, surtout

qu’on ne sait pas si on aura du succès ou pas. Je ne veux pas payer si

ca ne marche pas. Elle doit pouvoir s’accomoder de millions

d’utilisateurs, être facile à maintenir et gérer au quotidien. Et tu es

tout seul sur ce projet, désolé.

Pas de souçis. Je vais

utiliser un backend

serverless dans le cloud.

Page 6: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 7: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Vous avez dit sans serveur ?

Page 8: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Serverless, une définition

Pas de serveur à installer ou gérer Grandit avec vos besoins

Haute-disponibilité par design Payer pour la valeur ajoutée

Page 9: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Serverless, pas uniquement votre code

Base de données

APICode

Outils de développement

Page 10: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 11: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

2002 2006

Lancement du

quotidien à Paris

1er quotidien de

France pour la 1ère fois

et de façon continue

jusqu’à aujourd’hui

Premier site

web

2007

Présent sur iOS dès les

débuts de l’iPhone

2010

11 rédactions locales

dans les principales

agglomérations

françaises

Un bureau

aux USA

2013

Un bureau

en Asie

Fusion des rédactions

print et numérique

2014 2015

Le numérique :

50% de l’audience

Twitter : 1 million

de followers

Le trafic mobile

dépasse le desktop

2016

Facebook : 2 millions

de fans

2017

1er média français à

développer une skill

pour Alexa, l’Assistant

vocal d’Amazon

Membre de

l’International Fact

Checking Network

2018

Utilisation de l’IA par la

rédaction

20Bot : 1er robot

conversationnel d’un

média d’info

Etre là où sont les gens

Page 12: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Mass media sur tous les supports

22,1 millions de lecteurs par mois

5,2 millions par jour*

10,6 M. 5 M.10,7 M. 2,6 M.

Source : ACPM One Global V3 2018 – Audiences Print, Internet fixe, Internet mobile et Internet tablette One Global 30 J - * Couverture jour cross media

Page 13: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

De l’importance du each

2013 2018

Page 14: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

De l’importance du each

Page 15: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Frontend

Page 16: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon Aurora

Table TableTableAPIFrontend

Page 17: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon Aurora

AWS Simple Queue Storage

Message

Table TableTableAPIFrontend

Page 18: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon Aurora

AWS Step Functions

AWS Simple Queue Storage

Message

Amazon ElastiCache

ElastiCache for

Redis

Amazon Elasticsearch Service

Search documents

Table TableTableAPIFrontend

SaaS

CRM

Page 19: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon Aurora

AWS Step Functions

AWS Simple Queue Storage

Message

Amazon ElastiCache

ElastiCache for

Redis

Amazon Elasticsearch Service

Search documents

Table TableTableAPI

Amazon Simple Email

Service (SES)

Frontend

SaaS

CRM

Page 20: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Le reach n’est rien sans l’engagement

# participatif+13% d’inscrits par jour

+87% de commentaires par jour

+432% d’interactions entre les membres

par jour

Page 21: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

20 Minutes en Serverless

# scalable 40+ Lambdas

10+ Step Functions

84.6 millions d’invocations par mois

56.6 ms de temps de réponse

Page 22: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

20 Minutes en Serverless

# flexible

pensé microservices, ajustable au niveau de la fonction

# économique

facturé à l’utilisation, moins de tâches ops

# innovant

nouveau paradigme de développement

Page 23: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 24: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

165+ services

TECHNICAL & BUSINESS SUPPORT

Support ProfessionalServices

Optimization Guidance

PartnerEcosystem

Training & Certification Solutions Management

Account Management

Security & Billing Reports

Personalized Dashboard

MARKETPLACE

Business AppsBusiness Intelligence

DevOps Tools Security Networking StorageDatabases

IoT

Rules Engine

Device Shadows

Device SDKs

Device Gateway

Registry

Local Compute

MIGRATIONSchema Conversion

Exabyte-ScaleData Migration

Application Migration

Database Migration

Server Migration

HYBRID

Integrated Networking

Data Integration

Integrated Identity & Access

Integrated Resource & Deployment Management

Integrated Devices& Edge Systems

ML / IACustom Model Training & Hosting

Conversational Chatbots

Image & Scene Recognition

Facial Recognition & Analysis

Deep Learning (Apache MXNet,

TensorFlow, & others)

Text to Speech

Facial Search

ENTERPRISEVirtual Desktops

App Streaming

Sharing & Collaboration

Corporate Email

Communications

Contact Center

MOBILEAPI Gateway

Single Integrated Console

Identity

Sync

Mobile Analytics

Mobile App Testing

Targeted Push Notifications

DEV/OPSOne-click App Deployment

DevOps Resource Management

Application Lifecycle Management

Containers

Triggers

Resource Templates

Build and Test

Analyze and Debug

Patching

ANALYTICS

Data Warehousing

Business Intelligence

Elasticsearch

Hadoop/Spark

Data Pipelines

Streaming Data Collection

ETLStreaming Data Analysis

Interactive SQL Queries

APP SERVICES

Queuing & Notifications

Workflow

Email

Transcoding

Search

INFRA

Regions

Availability Zones

Points of Presence

CORE SERVICESComputeVMs, Auto-scaling, Load Balancing, Containers, Virtual Private Servers, Batch Computing, Cloud Functions, Elastic GPUs, Edge Computing

StorageObject, Blocks, File, Archivals, Import/Export, Exabyte-scale data transfer

CDN

DatabasesRelational, NoSQL, Caching, Migration, PostgreSQL compatible

NetworkingVPC, DX, DNS

SECURITY & COMPLIANCE

Identity Management

Key Management & Storage

Monitoring & Logs

Configuration Compliance

Web Application Firewall

Assessment& Reporting

Resource & Usage Auditing

Access Control

Account Grouping

DDOS Protection

MANAGEMENT TOOLS

Monitoring

Manage Resources

Resource Templates

Configuration Tracking

Server Management

Service Catalogue

Page 25: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Beaucoup de plomberie

Page 26: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Je vous présente AWS Amplify

Page 27: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amplify – une CLI pour créer vos services

$ amplify add auth

$ amplify add storage

$ amplify add api

$ amplify push

Ajouter un Amazon Cognito User Pool

Créer un bucket Amazon S3 sécurisé

Ajouter une API REST ou GraphQL

Deployer le tout via AWS CloudFormation

Page 28: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amplify – une ensemble de librairies open-source

Page 29: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Construisons une App avec React

Page 30: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Démarrer avec Amplify

$ amplify init

$ amplify push

Page 31: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 32: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Créer le service

$ amplify add auth

$ amplify push

Page 33: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Modifier notre app

import Amplify from 'aws-amplify’;import { withAuthenticator } from 'aws-amplify-react’;// 'aws-amplify-react-native';

import awsmobile from './aws-exports’; Amplify.configure(awsmobile);

export default withAuthenticator(App);

Page 34: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 35: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

$ amplify add auth && amplify push

AWS Cloud

Clients

AWS Cognito User Pool

Accounts

Multi Factor

Authentication

Signup & Signin

Page 36: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 37: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

https://2018.stateofjs.com/data-layer/overview

Page 38: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

query GetNote {

getNote(id: ”1”) {

id

value

}

}

mutation CreateNote {

createNote(value: “My first note”) {

id

value

}

}

subscription OnCreateNote {

onCreateNote {

id

value

}

}

GraphQL, un language pour les APIs

type Note {

id: ID!

value: String!

}

Page 39: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AppSync, un moteur d’exécution des requêtes

query GetPost {

getPosts(id: ”1”) {

id

title

comments {

content

}

author {

name

}

}

}

query GetPost {

getPosts(id: ”1”) {

id

title

comments {

content

}

author {

name

}

}

}

Amazon

EC2

{"data" : {"posts" : [{"id" : 1,"title" : "Introduction to GraphQL","comments" : [{"content" : "I want GraphQL for my next App!"

}],"author" : {"name" : "Sébastien Stormacq"

}}

]}

}

Amazon

DynamoDB

AWS

Lambda

Page 40: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Créer votre API

$ amplify add api

$ amplify push

Page 41: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

$ amplify add api

$ amplify add api? Please select from one of the below mentioned services GraphQL? Provide API name: amplifynotes? Choose an authorization type for the API Amazon Cognito User PoolUsing service: Cognito, provided by: awscloudformationThe current configured provider is Amazon Cognito.? Do you want to use the default authentication and security configuration?Yes, use the default configuration.Successfully added auth resource? Do you have an annotated GraphQL schema? No? Do you want a guided schema creation? true? What best describes your project: Objects with fine-grained access control (e.g., a project management app with owner-based authorization)? Do you want to edit the schema now? YesPlease edit the file in your editor: /<path>/amplify/backend/api/amplifynotes/schema.graphql? Press enter to continue

Page 42: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Un schéma de base

type Note {id: ID!note: String!

}

Page 43: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Transformers (aka Annotations)

type Note@model @auth(rules: [{allow: owner}]){id: ID!note: String!

}

Page 44: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 45: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

$ amplify add api & @model

AWS Cloud

Clients

AWS AppSync Amazon DynamoDB

Table

Schemas Resolvers Data Sourcestype Query {

getNote(...): NotelistNotes(...): Note

}

type Mutation {createNote(...): NoteupdateNote(...): NotedeleteNote(...): Note

}

type Subscription {onCreateNote (...): NoteonUpdateNote (...): NoteonDeleteNotet(...): Note

}

type Note {id: ID!value: String

}

queries

mutations

getNote

listNotes

updateNote

deleteNote

createNote

Note Table

Datasource

IAM RoleARN

Note RoleARN

Page 46: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 47: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Changer votre modèle GraphQL

type Note@model @auth(rules: [{allow: owner}])@searchable {id: ID!note: String!

}

Page 48: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Créer le service

$ amplify push

Page 49: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 50: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

@searchable

AWS Cloud

Clients

AWS AppSync Amazon DynamoDB

Table

Schemas Resolvers Data Sources

queries

mutations

getNote

listNotes

updateNote

deleteNote

createNote

Note Table

Datasource

IAM RoleARN

Note RoleARN

type Query {getNote(...): NotelistNotes(...): Note

}

type Mutation {createNote(...): NoteupdateNote(...): NotedeleteNote(...): Note

}

type Subscription {onCreateNote (...): NoteonUpdateNote (...): NoteonDeleteNotet(...): Note

}

type Note {id: ID!value: String

}

Page 51: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

@searchable

AWS Cloud

Clients

AWS AppSync

Document Index

Amazon ElasticSearch

Schemas Resolvers Data Sourcestype Query {

getNote(...): NotelistNotes(...): NotesearchNotes(...): [Note]

}

type Mutation {createNote(...): NoteupdateNote(...): NotedeleteNote(...): Note

}

type Subscription {onCreateNote (...): NoteonUpdateNote (...): NoteonDeleteNotet(...): Note

}

type Note {id: ID!value: String

}

queries

mutations

getNote

listNotes

updateNote

deleteNote

createNote

ElasticSearch

Datasource

IAM RoleARN

ESDomain

ARN

Streaming

Lambda

Note Table

Datasource

IAM RoleARN

Note RoleARN

searchNotes

Amazon DynamoDB

Table

Page 52: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 53: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Créer le service

$ amplify add hosting

$ amplify publish

Page 54: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

amplify add hosting

$ amplify add hosting? Select the environment setup: DEV (S3 only with HTTP)? hosting bucket name my_hosting_bucket? index doc for the website index.html? error doc for the website index.html

Page 55: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 56: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

amplify publish (dev)

AWS Cloud

Clients

Amazon Cloudfront Amazon S3

Bucket serving

static web content

Edge Locations

Page 57: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

amplify publish (prod)

AWS Cloud

Clients

Amazon Cloudfront Amazon S3

Bucket serving

static web content

Edge Locations

Page 58: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 59: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amplify – Ceinture noire

🥋$ amplify checkout ENV

$ amplify add ENV

Page 60: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amplify – Ceinture noire

🥋

Page 61: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amplify – Ceinture noire

🥋

Page 62: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Récapitulons

Une web app et des services cloud serverless

• Avec authentification et enregistrement (Amazon Cognito)

• API GraphQL (AWS AppSync + Amazon DynamoDB)

• API de recherche full-text (Amazon ElasticSearch)

• Déploiement et hébergement (Amazon S3, Amazon CloudFront)

https://github.com/sebsto/amplify-react-workshop

Page 63: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Mot d’ordre

Page 64: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

Merci !

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Sébastien Stormacq

Technical Evangelist, AWS EMEA

@ sebsto

Aurélien Capdecomme

CTO, 20 Minutes

@ menthefraiche

Page 65: S U M M I T - Amazon Web Services... · 2019-04-04 · Simplifier vos frontends à l’aidede backends serverless dans le cloud M A P 3 0 2 Sébastien Stormacq ... Amazon Web Services,

SUMM IT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.