Saturday, 14 October 2017

Wordpress AWS Part 5 - Beanstalk

Beanstalk


We are going to use Beanstalk to create our auto scaled, auto load balanced, installed-with-Apache-and-PHP virtual machines (known as "EC2 instances" in Amazon).

Click "Services", "Elastic Beanstalk".
Click "Create New Application"
Enter desired name, description, click "Create".
Click "Create one now" to create the enviroment for our application.
Choose "Web server environment", click "Select".
Enter desired domain, description. Scroll down for more...
For "Platform", choose "Preconfigured platform", "PHP". Click "Configure more options".
Choose "High availability", click "Change platform configuration".
Choose "PHP 5.6" (because Wordpress seems to work better in PHP 5), click "Save".
In the "Security" box, click "Modify". (We are going to specify the key pair.)
Choose your key pair, click "Save". (If you do not have a key pair, see part 4.)
Click "Create environment".
When it is all done, it will look something like this.
Notice that it is now running a "Sample Application".
Note the "URL" at the top, and visit that URL...
... to see the "Sample Application".
Go back to Amazon, click "Services", "EC2".
Notice that "1 Running Instances" and "1 Load Balancers" are automatically created for us.
At this juncture, we need to find out the security group that our Beanstalk-managed EC2 instance is running under, the security group of the EFS, and the security group of the RDS, and configure the appropriate inbound rules so that our Beanstalk-managed EC2 instance can access the EFS and RDS.

Find out the security group of our Beanstalk-managed EC2 instances.
Go Beanstalk, click the app's environment, click "Configuration", then that gear icon in the "Instances" box.
Note the name of the security group.
"Services", "EC2", "Security Groups". Use the name to find the ID.
Select the security group that our EFS and RDS are running under (by default, they will be in the "default" security group).
Click "Inbound" tab, "Edit", and add the rules.

Part 1 - Overview
Part 2 - RDS
Part 3 - EFS
Part 4 - Key Pairs
Part 5 - Beanstalk
Part 6 - ebextensions Folder
Part 7 - Deploy Wordpress
Part 8 - 4000 Concurrent Connections