Show how to deploy a sample PHP application on AWS Elastic Beanstalk using AutoScaling, LoadBalancer, and a pre-existing ElastiCache (memcached) cluster for PHP session storage. The required EC2 instances will be created within a pre-existing VPC and subnets.
a) You need to install the Elastic Beanstalk Command Line Interface (EB CLI) - See the instructions.
b) Have a previously created VPC and its subnets.
c) Have a previously created ElastiCache cluster.
NOTE: You may automate b and c using Elastic Beanstalk Environment Resources. For the purposes of this demo, we assume you already have a VPC and a ElastiCache cluster.
-
Clone
git clone https://github.com/jweyrich/aws-demo-php-eb-elasticache.git cd aws-demo-php-eb-elasticache
-
Configure required details
a) Edit VPC/EC2 details on .ebextensions\01_instance.config
.
b) Edit the ElastiCache host on .ebextensions\04_memcached.config
.
c) Add and commit your changes:
```
git commit -a -m 'My changes.'
```
-
Deploy
eb deploy