Hi I just started using AWS lambda and am building in Java. Currently, I have a solid speechlet, sample utterances, miscellaneous back end code, and intents. Do you happen to have an example of a complete .zip or structured project that one would actually upload to the AWS lambda server? I don't know what other files and information I need to include. I couldn't find an answer on the other official pages, as they basically just say to put stuff in a zip and upload it. It would be nice if a uploaded .zip of hello world is provided as a download so I can see the structure rather than an explanation in words. Thank You!
There's a sample project in the EchoProofOfConcepts project here:
https://github.com/jjaquinta/EchoProofOfConcepts called jo.echo.lambda. The directory structure used for the project should directly correspond to the structure needed in the ZIP. I.e. if you zipped the contents of the project folder, you should get a ZIP suitable for uploading.
It's pretty strict. You class files must be in directories named after the package they are in. (Just like a jar file.) If you have dependent jar files, they must be in a directory named "lib" in the root of the zip.
Thanks again for the helpful info :) Another question: do we have to package every used import/.jar to that .zip file or are there some libraries they might provide (such as the amazon sdk)? If we don't have to package certain things, then do we have to structure the import statements differently?
I think the Lambda jar file is in the environment, but that's it. Given the plethora of dependent jars, I just bundle the whole thing. It's a pain, but there you go. If you want to experiment, print the classpath while running to the lot file. See if there is anything other than your jars on it. As for gradle... I'm allergic to it. Never use it. (If you note, in my dump above, I use 7z from the command line!) So, no, there's nothing special about how it ZIPs things. Anything that produces a zip formatted file will do.