Friday, 13 October 2017

Wordpress AWS Part 4 - Key Pairs

Key Pairs


Amazon wants us to use keys to SSH into those EC2 instances created by Beanstalk.

First we need to create a key pair in AWS. This is done under EC2. Click "Key Pairs" on the left, click "Create Key Pair".
Create key pair
Key in your desired name for the key pair, click "Create"...
Key in name and click "Create".

The moment you click "Create", a key pair will be created in AWS, and you will be prompted to download the private key. DOWNLOAD the private key NOW! Amazon will not give you another chance to download the private key, neither will there be any download link.
Click "Save" to download the private key.
Later on, when we create the EC2 instances via Beanstalk, we will be given an opportunity to select the key pair to be used. Beanstalk will allow you to change the key pair after creation of the EC2 instances, but the change actually makes Beanstalk tear down all existing EC2 instances and create new EC2 instances.

If you are using Putty as SSH client, you need to convert the private key in to Putty's own .ppk format. How we actually do that is beyond the scope of this article, but here are a few screenshots...

Launch "PuttyGen", click "Load".
Load the private key from Amazon.
Click "OK".
Click "Save private key".
Click "Yes".
Key in desired name for Putty format private key, click "Save".
Specify the Putty format private key when connecting to EC2 instance.
Where to find the public IP of an EC2 instance.

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