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