question

Noel Portugal avatar image
Noel Portugal asked

Deploying to AWS Elastic Beanstalk

I have been able to follow documentation and run the HelloWorldSpeechlet example locally by using the Launcher.java. I wold like to get recommendations/guides to deploy to a real environment like AWS Elastic Beanstalk. Thanks!
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rgr@amazon avatar image
rgr@amazon answered
We have a helper class called SpeechletServlet which is based on the HttpServlet specification, It handles requests coming from the Echo Platform.
Since this is based on the HttpServlet specifications. It can be hosted in any servlet container e.g. Tomcat which supported by AWS Elastic beanstalk.

Example Code:
package helloworld;
import com.amazon.speech.speechlet.servlet.SpeechletServlet;
@SuppressWarnings("serial")
public class HelloWorldServlet extends SpeechletServlet {
public HelloWorldServlet() {
this.setSpeechlet(new HelloWorldSpeechlet());
}
}


Then add the new Servlet in your web.xml file:
<|?xml version="1.0" encoding="UTF-8"?>
<|web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<|servlet>
<|servlet-name>HelloWorldServlet<|/servlet-name>
<|servlet-class>helloworld.HelloWorldServlet<|/servlet-class>
<|/servlet>
<|servlet-mapping>
<|servlet-name>HelloWorldServlet<|/servlet-name>
<|url-pattern>/hello<|/url-pattern>
<|/servlet-mapping>
<|/web-app>


e sure to copy all the Echo SDK /lib and /third-party dependencies to the WebContent/WEB-INF/lib folder of your AWS Elastic beanstalk project.
Then deploy you project to AWS Elastic Beanstalk and enable ssl - Configuring HTTPS for your AWS Elastic Beanstalk Environment
Thank you very much for your feedback.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Noel Portugal avatar image
Noel Portugal answered
Thanks!, One thing I'm struggling with is to find a [free] way to deploy my code without having to buy an SSL certificate! So I was hoping we could use self-signed certs. Or if Amazon could have an Echo AWS PaaS service where I can just deploy my code. Noel
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rgr@amazon avatar image
rgr@amazon answered
We currently support self-signed Certificates for dev/test to support this very use-case. please see the Echo SDK Getting Started for details.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.