简体   繁体   中英

Is it possible to use more than one dynamodb table

I've created a skill that will pull data from my dynamodb table depending on what is asked.

I now want to further develop this and use the same skill to find different types of data from different tables. I was wondering if this is possible and how i would go about doing this?

When building an Alexa skill you do the mapping of intent to action/code/service (which in your case is an AWS Lambda). So when a user says something like X you do Y. For example

  • How's the weather? -> weather lambda
  • What's the forecast? -> weather lambda
  • What's the moon phase? -> moon phase lambda
  • What does the moon look like? -> moon phase lambda

Assuming your examples are closely related enough where the code is the exact same except for what DynamoDB table it retrieves it's data from you can use the same code to create 2 different lambdas and utilize Environment Variables to define which table to select from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM