Well, I finally got my code switched over to using the AWS DynamoDB instance for its back end, at least locally. Yay!
(Biggest pitfall, for me: AWS configuration MUST be done BEFORE creating the DynamoDB client objects. With how I currently have the code organized, that gets a bit messy when both Jovo and my own code want to use Dynamo; I have it working but I need to clean it up.)
It’s running happily when I do jovo run
and have Alexa talking to my own machine’s webhook.
HOWEVER:
… Unfortunately, it’s been a long time since I actually deployed code up to the lambda. In the past I used the jovo3 deploy --target zip
approach, but that’s currently giving me an error message:
> Bundle Project
√ Copy source code to "./bundle"
× Run "npm install --production"
→ [11:30:12] 'build-ts' errored after 7.46 s
Zip "./bundle" folder
» Error: There was a problem:
» Error: Command failed: npm run bundle
» [11:30:12] 'compileTs' errored after 7.45 s
» [11:30:12] Error: Non-zero exit code of "2"
» at ChildProcess.<anonymous> (C:\Users\keshlam\jovo\new-sounds-on-demand\node
» _modules\gulp-run-command\index.es5.js:120:15)
» at ChildProcess.emit (node:events:520:28)
» at ChildProcess.emit (node:domain:537:15)
» at ChildProcess.cp.emit (C:\Users\keshlam\jovo\new-sounds-on-demand\node_mod
» ules\cross-spawn\lib\enoent.js:40:29)
» at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
» at Process.callbackTrampoline (node:internal/async_hooks:130:17)
» [11:30:12] 'build-ts' errored after 7.46 s
Theoretically my project.js file is configured to support lambda as one of the Stages (copy will follow), but as far as I can tell jovo3 deploy --stage lambda
is not automatically uploading to the Lambda.
For what it’s worth, neither is leaving me with anything in the bundle
directory.
I’m sure I’m missing something obvious again. Any ideas what?
Thanks in advance, as always. SO close to being able to ask Amazon to consider this for public release…!
/////////////////////////////////////////////////////////////////////////////////////////
// project.js
module.exports = {
stages: {
local: {
endpoint: '${JOVO_WEBHOOK_URL}'
},
lambda: {
arn: 'arn:aws:lambda:us-east-1:046935287063:function:prod-new-sounds-on-demand',
askProfile: 'admin', // if left out: "default" profile is used
endpoint: 'arn:aws:lambda:us-east-1:046935287063:function:prod-new-sounds-on-demand'
}
},
alexaSkill: {
nlu: 'alexa',
manifest: {
apis: {
custom: {
interfaces: [
{
type: 'AUDIO_PLAYER',
},
],
},
},
},
},
googleAction: {
nlu: 'dialogflow',
projectId: `new-sounds-on-demand`,
},
}