Search code examples
amazon-web-servicesamazon-ec2amazon-elastic-beanstalkamazon-ami

Amazon AWS ElasticBeanstalk custom AMI


I am trying to use a custom AMI in AWS Beanstalk. I manually launched a default Amazon ElasticBeanstalk image in EC2 (ElasticBeanstalk-Tomcat7-32bit-20110913-1132 (ami-278e4c4e)) and created my custom AMI from that. I then go to ElasticBeanstalk, launch an Environment and once it's up and running, I switch to this custom AMI in the Environment's configuration.

The health status is green. But my webapp does not get deployed on the instance:

[root@ip-***-***-***-*** ~]# ls -l /opt/tomcat7/webapps
total 0

Tomcat is running:

[root@ip-***-***-***-*** ~]# /etc/init.d/tomcat7 status
Tomcat 7 is running.

I am puzzled about why my app does not get deployed. Does anyone know what's going wrong?


Solution

  • I meanwhile figured out the problem. When you create your own AMI from one of the Amazon predefined Beanstalk images, and you don't actually make any changes to the file system (install anything, create files, etc.), AWS will NOT create a new snapshot while creating a custom AMI. The created AMI will not work in Beanstalk then.

    As long as you make any changes to the default image before you create your own custom AMI, everything should work fine.