Customizing an Elastic Beanstalk AMI

andreaxi picture andreaxi · Aug 17, 2012 · Viewed 8k times · Source

I need to use on Elastic Beanstalk a Java application written for Glassfish server. Beacuse of Amazon doesn't let me choose an AMI with Glassfish, I choosed one with Tomcat and i modified my application to work properly on Tomcat.

Now, I've seen I also needed to use a Sun JDK, while by default Elastic Beanstalk AMI comes with openjdk. I googled a lot, finding some (not so many resources) interesting posts like this answer on StackOverflow

What I can't understand is this part of the answer:

Create your custom AMI from a running instance of Amazon's beanstalk AMI that you manually launch from EC2, NOT one that was launched from starting your application through beanstalk.

So, my question is: does anyone how to use a custom AMI with Glassfish on Elastic Beanstalk? If it's not possible, can someone explain me how to create the custom AMI?

Thanks, Andrea

Answer

Christopher picture Christopher · Aug 17, 2012

That answer just means "Don't start a beanstalk application and cut an AMI directly from one of those instances. Instead, launch an instance based on the beanstalk AMIs (which are available in the public AMI listing)." I.e., use one of these; note there are 84 of them:

Beanstalk AMIs

Cut your own private AMI when you're done configuring that instance, and specify it in your beanstalk environment.