I found it to be a 2-step process. This assumes that you've already set up a keypair to access EC2 instances in the relevant region.
Configure Security Group
In the AWS console, open the EC2 tab.
Select the relevant region and click on Security Group.
You should have an elasticbeanstalk-default
security group if you have launched an Elastic Beanstalk instance in that region.
Edit the security group to add a rule for SSH access. The below will lock it down to only allow ingress from a specific IP address.
SSH | tcp | 22 | 22 | 192.168.1.1/32
Configure the environment of your Elastic Beanstalk Application
- If you haven't made a key pair yet, make one by clicking Key Pairs below Security Group in the ec2 tab.
- In the AWS console, open the Elastic Beanstalk tab.
- Select the relevant region.
- Select relevant Environment
- Select Configurations in left pane.
- Select Security.
- Under "EC2 key pair:", select the name of your keypair in the
Existing Key Pair
field.
If after these steps you see that the Health is set Degraded
that's normal and it just means that the EC2 instance is being updated. Just wait on a few seconds it'll be Ok again
Once the instance has relaunched, you need to get the host name from the AWS Console EC2 instances tab, or via the API. You should then be able to ssh onto the server.
$ ssh -i path/to/keypair.pub ec2-user@ec2-an-ip-address.compute-1.amazonaws.com
Note: For adding a keypair to the environment configuration, the instances' termination protection must be off as Beanstalk would try to terminate the current instances and start new instances with the KeyPair.
Note: If something is not working, check the "Events" tab in the Beanstalk application / environments and find out what went wrong.
First off, EC2 and Elastic Compute Cloud are the same thing.
Next, AWS encompasses the range of Web Services that includes EC2 and Elastic Beanstalk. It also includes many others such as S3, RDS, DynamoDB, and all the others.
EC2
EC2 is Amazon's service that allows you to create a server (AWS calls these instances) in the AWS cloud. You pay by the hour and only what you use. You can do whatever you want with this instance as well as launch n
number of instances.
Elastic Beanstalk
Elastic Beanstalk is one layer of abstraction away from the EC2 layer. Elastic Beanstalk will setup an "environment" for you that can contain a number of EC2 instances, an optional database, as well as a few other AWS components such as a Elastic Load Balancer, Auto-Scaling Group, Security Group. Then Elastic Beanstalk will manage these items for you whenever you want to update your software running in AWS. Elastic Beanstalk doesn't add any cost on top of these resources that it creates for you. If you have 10 hours of EC2 usage, then all you pay is 10 compute hours.
Running Wordpress
For running Wordpress, it is whatever you are most comfortable with. You could run it straight on a single EC2 instance, you could use a solution from the AWS Marketplace, or you could use Elastic Beanstalk.
What to pick?
In the case that you want to reduce system operations and just focus on the website, then Elastic Beanstalk would be the best choice for that. Elastic Beanstalk supports a PHP stack (as well as others). You can keep your site in version control and easily deploy to your environment whenever you make changes. It will also setup an Autoscaling group which can spawn up more EC2 instances if traffic is growing.
Here's the first result off of Google when searching for "elastic beanstalk wordpress": https://www.otreva.com/blog/deploying-wordpress-amazon-web-services-aws-ec2-rds-via-elasticbeanstalk/
Best Answer
Since July 2013 Elastic Beanstalk supports "single-instance" environments that have a single container instance running without a load balancer. Existing environments that are set up using "load balancing environment" can be switched to "single instance" and vice versa.
Prior to this it was not possible to remove the load balancer and have Elastic Beanstalk still work correctly. The load balancer is an integral part of the way that Elastic Beanstalk works in "load-balancing environment" configurations.