ask-toolkit-for-vscode
ask-toolkit-for-vscode copied to clipboard
local debugging of skills using persistent storage not working
Desktop (please complete the following information):
- OS: Windows 11
- VS Code version: 1.77.3
- Alexa Skill Toolkit extension version: v2.14.1
Question persistent storage not working with local debugging.
when i run the skill in the console it works fine. i download the alexa-hosted-skill code, start the debugger with no issues. when i invoke the skill with an intent that tries to read from the s3 storage i get the following error:
when i try an intent that uses dynamodb, i get this error:
~~~ Error handled: AskSdk.DynamoDbPersistenceAdapter Error: Could not read item (amzn1.ask.account......) from table (undefined): Missing required key 'TableName' in params
is this expected behavior that we would not be able to locally debug skills that use any persistent storage?
these look like things set in env variables for lambda, so perhaps i am missing a setting somewhere???
Thanks for reporting @voco-dev ! We'll take a look into how this could be supported.
To make sure we're getting as close to your use case as possible, do you have a snippet (with any sensitive info redacted) from your lambda that illustrates how you're reading from s3 storage?
I was pretty much following the documentation. My code just retrieves the file from s3 using axios
... const fileUrl = this.getS3PreSignedUrl("Media/menu-data.json"); try { const res = await Axios.get(fileUrl); ...
the example code from hello world util.js:
const s3SigV4Client = new AWS.S3({ signatureVersion: 'v4', region: process.env.S3_PERSISTENCE_REGION });
module.exports.getS3PreSignedUrl = function getS3PreSignedUrl(s3ObjectKey) {
const bucketName = process.env.S3_PERSISTENCE_BUCKET;
const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {
Bucket: bucketName,
Key: s3ObjectKey,
Expires: 60*1 // the Expires is capped for 1 minute
});
console.log(`Util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`);
return s3PreSignedUrl;
}
error is:
Thanks for the additional info!