Stack Overflow: A New Way for Developers to Get Support for Alexa

Now you can find Alexa-specific tags and topics in the AWS Collective on Stack Overflow. Ask questions and get help from badged experts and the Alexa developer community!

question

newuser-abb5d051-3ff0-4265-84b7-ba58dde36dc6 avatar image

CRUD from Alexa Developer Console to AWS hosted Dynamo DB

I have connected to my Alexa Developer Console to AWS hosted Dynamo DB using:

  // 1. Assume the AWS resource role using STS AssumeRole Action
    const STS = new AWS.STS({ apiVersion: '2012-10-17' });
    const credentials = await STS.assumeRole({
        RoleArn: 'arn:aws:iam::836374152057:role/OpenCareQuestionnaire',
        RoleSessionName: 'SaveBathingSlot' // You can rename with any name
    }, (err, res) => {
        if (err) {
            console.log('AssumeRole FAILED: ', err);
            throw new Error('Error while assuming role');
        }
        return res;
    }).promise();
    
    const dynamoDB = new AWS.DynamoDB({
            apiVersion: '2012-08-10',
            accessKeyId: credentials.Credentials.AccessKeyId,
            secretAccessKey: credentials.Credentials.SecretAccessKey,
            sessionToken: credentials.Credentials.SessionToken
        });
    
    const tableData = await dynamoDB.scan({ TableName: 'my-care-questionnaire' }, (err, data) => {
        if (err) {
            console.log('Scan FAILED', err);
            throw new Error('Error while scanning table');
        }
        console.log(data);
    }).promise();

following this link: https://developer.amazon.com/en-US/docs/alexa/hosted-skills/alexa-hosted-skills-personal-aws.html


Although I can see my data from:

console.log(data)

but I can't seem to do CRUD from my Alexa Developer Console.


I also tried

var docClient = new AWS.DynamoDB.DocumentClient();

but it doesn't seem to connect to my AWS hosted DynamoDB.


The document seems a little incomplete to me and I am wondering if it's possible to do CRUD from Alexa Developer Console to my AWS hosted DynamoDB.

Thank you.


alexa skills kitapiawsdynamodb
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers