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


Published on

Learn how to develop voice-based serverless back ends for Alexa Voice Service (AVS) and Alexa devices using the Alexa Skills Kit (ASK), which allows you to add new voice-based interactions to Alexa. We’ll code a new skill, implemented by a serverless backend leveraging AWS services such as Amazon Cognito, AWS Lambda, and Amazon DynamoDB. Often, your skill needs to authenticate your users and link them back to your backend systems and to persist state between user invocations. User authentication is performed by leveraging OAuth compatible identity systems. Running such a system on your back end requires undifferentiated heavy lifting or boilerplate code. We’ll leverage Login with Amazon as the identity provider instead, allowing you to focus on your application implementation and not on the low-level user management parts. At the end of this session, you’ll be able to develop your own Alexa skills and use Amazon and AWS services to minimize the required backend infrastructure. This session shows you how to deploy your Alexa skill code on a serverless infrastructure, leverage AWS Lambda, use Amazon Cognito and Login with Amazon to authenticate users, and leverage AWS DynamoDB as a fully managed NoSQL data store.

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

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

  1. 1. © 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
  2. 2. 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
  3. 3. 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
  4. 4. If you missed the Alexa Skill Kit…
  5. 5. Areas of improvement • Infrastructure management • Identity management • Persistence • Fine-grained permissions
  6. 6. Solution architecture
  7. 7. 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
  8. 8. Improvements to infrastructure management
  9. 9. Infrastructure management Your skill code
  10. 10. Infrastructure management Amazon EC2
  11. 11. Infrastructure management
  12. 12. Infrastructure management
  13. 13. Infrastructure management AWS Lambda Amazon DynamoDB Amazon Cognito
  14. 14. Improvements to managed service: Lambda and DynamoDB
  15. 15. Managed service benefits • Lower operational burden • Lower cost • Internet scalability • Designed for very high availability
  16. 16. Improvements to identity management
  17. 17. Identify user across accounts/skills Unique for { Amazon Account, Enabled Skill }
  18. 18. Identify user across accounts/skills How to recognize users with multiple Amazon accounts? How to recognize users after they re-enable the skill?
  19. 19. Improvements to account linking
  20. 20. Linking Alexa Skills with Login with Amazon
  21. 21. Account linking benefits Stable account across: • Multiple Amazon accounts • Multiple skills • Skills re-enablement
  22. 22. Amazon Cognito benefits • Stable identity ID • Distributes AWS credentials • Limited in time • Limited in scope
  23. 23. Improvements that enable persistence
  24. 24. User profile persistence Let Alexa remember user preferences
  25. 25. User profile persistence Let Alexa remember history
  26. 26. User profile persistence Let Alexa remember context
  27. 27. Improvements to persistence (without adding infrastructure)
  28. 28. Built into our ASK SDK for Node.js
  29. 29. Improvement for fine-grained control: DynamoDB
  30. 30. DynamoDB benefits • Entirely managed • Internet scalability • Cost effective
  31. 31. Improvement for fine-grained control: DynamoDB access
  32. 32. Limit Lambda permissions per user Is there a better way?
  33. 33. Improvement for fine-grained control: Limit access to DynamoDB
  34. 34. What ?
  35. 35. Where ?
  36. 36. Who ?
  37. 37. AWS IAM roles benefits • Distinct access policies for Lambda vs. authenticated users • Access to user’s DynamoDB items only
  38. 38. Benefits summary
  39. 39. 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
  40. 40. Thank you! @sebsto
  41. 41. Remember to complete your evaluations!
  42. 42. Thursday 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 806 Friday 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