Top Banner
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Sébastien Stormacq, Solution Architect, Alexa ALX302 12/1/16 Build a Serverless Back End for Your Alexa-Based Voice Interactions
59

AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Apr 16, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Sébastien Stormacq, Solution Architect, Alexa

ALX302

12/1/16

Build a Serverless Back End for Your Alexa-Based Voice Interactions

Page 2: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

What to Expect from the Session

• Learn about serverless back end

• Learn about persistence for Alexa Skills

• Learn about tight AWS security to the user invoking your

skill

What to expect from the session

Page 3: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

What to Expect from the Session

• Login With Amazon

• AWS Lambda

• Amazon Cognito

• AWS Identity and Access Management

• Amazon DynamoDB

What to expect from the session

Page 4: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

If you missed the Alexa Skill Kit…

Page 5: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 6: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Areas of improvement

• Infrastructure management

• Identity management

• Persistence

• Fine-grained permissions

Page 7: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Solution architecture

Page 8: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Your Skill Token

NoSQL database

Exchange LWA token for

AWS access key and secret key

Authenticate user

Receives OAuth token

Invoke

w/OAuth token

Identity provider

Use access key and secret key

to read/write items

Page 9: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements to infrastructure

management

Page 10: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Infrastructure management

Your skill code

Page 11: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Infrastructure management

Amazon EC2

Page 12: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Infrastructure management

Page 13: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Infrastructure management

Page 14: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Infrastructure management

AWS Lambda

Amazon DynamoDB

Amazon Cognito

Page 15: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements to managed service:

Lambda and DynamoDB

Page 16: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 17: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Managed service benefits

• Lower operational burden

• Lower cost

• Internet scalability

• Designed for very high availability

Page 18: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements to identity management

Page 19: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Identify user across accounts/skills

Unique for { Amazon Account, Enabled Skill }

Page 20: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Identify user across accounts/skills

How to recognize users with multiple Amazon accounts?

How to recognize users after they re-enable the skill?

Page 21: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements to account linking

Page 22: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 23: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 24: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 25: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 26: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Linking Alexa Skills with Login with Amazon

Page 27: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Account linking benefits

Stable account across:

• Multiple Amazon accounts

• Multiple skills

• Skills re-enablement

Page 28: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 29: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 30: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 31: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 32: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 33: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Amazon Cognito benefits

• Stable identity ID

• Distributes AWS credentials

• Limited in time

• Limited in scope

Page 34: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements that enable persistence

Page 35: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

User profile persistence

Let Alexa remember user preferences

Page 36: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

User profile persistence

Let Alexa remember history

Page 37: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

User profile persistence

Let Alexa remember context

Page 38: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvements to persistence (without adding

infrastructure)

Page 39: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 40: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Built into our ASK SDK for Node.js

http://sebs.to/asksdknodejs

Page 41: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 42: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvement for fine-grained

control: DynamoDB

Page 43: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 44: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 45: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 46: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

DynamoDB benefits

• Entirely managed

• Internet scalability

• Cost effective

Page 47: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvement for fine-grained control:

DynamoDB access

Page 48: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Limit Lambda permissions per user

Is there a better way?

Page 49: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Improvement for fine-grained control:

Limit access to DynamoDB

Page 50: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)
Page 51: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

What ?

Page 52: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Where ?

Page 53: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Who ?

Page 54: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

AWS IAM roles benefits

• Distinct access policies for Lambda vs. authenticated

users

• Access to user’s DynamoDB items only

Page 55: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Benefits summary

Page 56: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Benefits

• No server-side infrastructure to manage

• Stable Amazon Cognito identity (across devices and

platforms)

• Lambda permissions limited per users

• Internet-style scalability

• Cost effective

Page 57: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Thank you!

@sebsto

Page 58: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Remember to complete

your evaluations!

Page 59: AWS re:Invent 2016: Build a Serverless Back End for Your Alexa-Based Voice Interactions(ALX302)

Thurs

day

11:30am ALX202: How Amazon Is Enabling the Future of Automotive Venetian, Level 3, Lido

3003

1pm ALX303: Building a Smarter Home with Alexa Venetian, Level 3,

Murano 3203

3:30 ALX307: Voice-enabling Your Home and Devices with Amazon Alexa and AWS

IoT

Venetian, Level 2,

Opaline Theatre

5pm ALX302: Build a Serverless Back End for Your Alexa-Based Voice Interactions Venetian, Level 2,

Opaline Theatre

9:30am ALX304: Tips and Tricks on Bringing Alexa to Your Products Venetian, Level 1, Marco

Polo 806

11am ALX305: From VUI to QA: Building a Voice-Based Adventure Game for Alexa Venetian, Level 1, Marco

Polo 806Friday

11am ALX203: Workshop: Creating Voice Experiences with Alexa Skills: From Idea to

Testing in Two Hours

Mirage, Jamaica B

1pm ALX306: State of the Union: Amazon Alexa and Recent Advances in

Conversational AI

Venetian, Level 2, Sands

Showroom

11:30am

and 2:30pm

ALX204: Workshop: Build an Alexa-Enabled Product with Raspberry Pi Mirage, Antigua B

5pm ALX301: Alexa in the Enterprise: How JPL Leverages Alexa to Further Space

Exploration with Internet of Things

Venetian, Level 2,

Venetian B

Wednesday