Here is some boilerplate code for updating the skill via the cmd line
I use the AWS CLI (https://aws.amazon.com/cli/) to submit the code as a zip file. You have to use S3 if you go past 10MB. Here’s a bash script for uploading a zip:
This has been added to day 3, on day 4 and 5 we will be exploring a library/boilerplate that another has developed that uses grunt to automatically deploy to AWS.
Here is some boilerplate code for updating the skill via the cmd line I use the AWS CLI (https://aws.amazon.com/cli/) to submit the code as a zip file. You have to use S3 if you go past 10MB. Here’s a bash script for uploading a zip:
!/bin/bash
zip the skill
pushd skill zip -r ../skill.zip * popd
deploy it
sudo aws lambda update-function-code --function-name Skill --zip-file fileb://skill.zip
test it
sudo aws lambda invoke --function-name Skill --payload file://skill/test.json output.txt cat output.txt echo sudo rm output.txt
Here’s one for using S3:
!/bin/bash
zip the skill
pushd skill rm ../skill.zip zip -r ../skill.zip * popd
deploy it
sudo aws s3 cp skill.zip s3://skill-bucket/ sudo aws lambda update-function-code --function-name Skill --s3-bucket skill-bucket --s3-key skill.zip
test it
sudo aws lambda invoke --function-name Skill --payload file://skill/test.json output.txt cat output.txt echo sudo rm output.txt
The test parts assume there’s a JSON file in the skill’s root directory called test.json that’s a valid Lambda event for testing the skill.