Keypairs, ec2-user-1.pem for us-east-1 and ec2-user-2.pem for us-west-2. Use the keys unable to locate

You’ve set up two instances, each in a separate VPC and a different region. But your goal is to establish the connection between two instances, so that they can connect each other over private IP. Before establishing any peering connection, we want you to test the current scenario first.

To access the first instance in us-east-1, execute the following command from your lab machine:

ssh -i ec2-user-1.pem ec2-user@<public-IP-of-ec2-east>

After successfully logging into the ec2-east instance, proceed to access the second instance, ec2-west, which is in us-west-2 using its private IP address:

ssh -i ec2-user-2.pem ec2-user@<private-IP-of-ec2-west>

LAB - Connecting three VPCs together in a region and in another region - 2

Q:7

Note: You might need to copy the .pem key file to the ec2-east instance using the following command:

scp -i ec2-user-1.pem ec2-user-2.pem ec2-user@<public-IP-of-ec2-east>:~/

Note that, we have two keypairs, ec2-user-1.pem for us-east-1 and ec2-user-2.pem for us-west-2. Use the keys based on the instance region.

I am unable to connect “cannot stat ‘ec2-user-2.pem’: No such file or directory” getting this error

A link to the lab where you’re doing this would be very helpful

Not sure which link you have mentioned.

First of all, WHAT COURSE ARE YOU TAKING? Once I know that, it also helps to get a link to the lab (the KodeKloud link) to that lab. Then I can find what you’re talking about.

My suspicion is that the layout of the KodeKloud lab page is what’s confusing you: there’s a terminal embedded in the page, but you have to click on the following icon to open it:

expand-icon

The icon is in the upper right of the screen. Click on it and the terminal will open. Once open, you’ll find the keypair files in the /root directory of the terminal.

AWS Cloud Practitioner

Did you open the terminal in the KodeKloud side of the lab (i.e., NOT the AWS console)? The keys should be there, as I mentioned in above, once you open the terminal.