Question

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?

Was it helpful?

Solution 3

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.

OTHER TIPS

well, the Beanstalk AMIs use a init script to copy your application from S3, and deploy it to the container (Tomcat). I would recommend: 1. Take a look on CloudInit logs at: /var/log/cloud-init.log. 2. If everything looks fine (or even empty), edit the script at /etc/sysconfig/cloudinit to add some traces just to check if the CloudInit script is executed, or is failing at some point.

I'm sorry no being able to give you a better help, but is hard from here to know what is happening!

What I normally do, is launch a Beanstalk Instance (not a Instance with a Beanstalk AMI), then I do the modifications on that instance, and to finish I create my custom AMI to do what you are trying to achieve.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top