Tuesday, December 31, 2019

AWS/DevOps: Generate a key pair with AWS Console for an EC2 Instance

Creating a key pair to assign to an AWS EC2 instance using AWS's Console is trivial. Why discuss such a task? I have a problem. I inherited an EC2 instance and the existing key is with a guy on vacation and offline. I am concerned that DevOps infrastructure exists the uses the key to access the existing EC2 instance so swapping keys is not an option. The solution is to clone the EC2 instance and assign the clone a known key pair, hence the need to create a new key.

Do not lose the key pair they can only be downloaded once. Do not entrust the key pair to a guy going skiing in a remote mountain resort with no cell phone connectivity. 

Generating a key pair with AWS Console for an EC2 instance is performed as follows:

1. Login to the AWS Console:

2. From the console, select EC2 (make sure the region is set correctly which for my project is US East (N. Virginia) us-east-1 to display the EC2 dashboard. You could search for EC2 but AWS puts EC2 top left under All services | Compute:

3. The left side of the EC2 Dashboard is as follows where key pairs can be managed and created using Network & Security | Key Pairs:

4. Click on Key Pairs reveals the following so to create the key pair click on Create Key Pair::

5. The Create Key Pair dialog is as follows and enter the name of the key pair to create with for this project is Passepartout paying homage to world traveler Jean Passepartout:

6. Click on the Create button to create the key pair. This will prompt the user to provided a save location:

The standard disclaimer applies: Do not lose the key pair they can only be downloaded once. 

No comments :

Post a Comment