Alexa Skill Quick Upload to S3

If you've developed a skill for alexa you know it can be painful to manually compress and then upload your skill to AWS Lambda each time you make changes. I created a makefile to automatically compress and upload the skill for you.

# Alexa Skill upload to S3
# Sean Smith 2017

S3_BUCKET = alexa.seanssmith.com 
ZIP_FILE = skill.zip

upload:
	aws s3 cp $(ZIP_FILE) s3://$(S3_BUCKET)
zip:
	zip -r $(ZIP_FILE) * \
		--exclude Makefile \
		--exclude $(ZIP_FILE)
clean: 
	-rm $(ZIP_FILE)

deploy: clean zip upload

Create a file called Makefile in the same directory as your skill's code, then paste in the above code. Change the two variables S3_BUCKET and ZIP_FILE (you can leave this as skill.zip if you'd like) and run:

make deploy

If you get an error bash: aws: command not found install and setup the aws cli.

If you get a permissions error you may need to setup your aws keys for the cli. Again see Setup AWS Cli.

Once you've deployed your skill to S3 you'll need to tell lambda to get that skill from S3. First go to S3, navigate the the bucket and filename that you gave your skill (in my example bucket name is alexa.seanssmith.com and skill name is skill.zip).

Copy the link as shown below:

Then head over to your Lambda skill and paste that link in as the source of code (you'll need to select "Upload a file from Amazon S3"). This is shown below:

Comments ()