I am using AWS Elastic Beanstalk, it is easy to start with deploying Java based web app, which is great.
However, I want to install Memcached on every instance locally so they can be used for caching, but seems it validated the principle of Elastic Beanstalk?
Is it possible to deploy memcached locally and automatically, together with Elastic Beanstalk's auto scale feature?
(I know I can use Elastic Cache but want to save some money but still take the advantage of auto scaling)
Thanks.
The possibility to customize your environments is indeed one of the key characteristics of AWS Elastic Beanstalk in comparison to other PaaS offerings:
What you are looking for is possible by facilitating a Custom AMI. Once you have launched an environment, you can customize its configuration details, amongst those the AMI used by your instances as illustrated in Configuring Servers. While there are some requirements to be met in order to properly execute within Beanstalk, you can basically customize these AMIs to your heart's content, the process is documented in Using Custom AMIs (for a 3rd party explanation see e.g. How to customize an Amazon Elastic Beanstalk instance).
Please be aware of the following implication though:
This means you will need to track the evolution of the AWS AMIs yourself to ensure stability and security of your application - this isn't as easy as it should be currently, as discussed e.g. in Amazon AMI product lifecycle questions and more recently Keeping up with the AWS Developers (Latest AMI's).
Good luck!
You can now configure AWS Elastic Beanstalk using configuration files. This is an alternative to creating and maintaining custom AMIs.
http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/customize-containers.html
It is currently supported on Tomcat 6/7, Python 2.6, and Ruby 1.8.7/1.9.3.
As written before using configuration file Create a file:
with the following: