An error occurred InvalidKeyPair NotFound when calling the RunInstances operation The key pair key123 pem does not exist

+1 vote

Hello everyone,

I am trying to create one EC2 instance from command line. But it shows me the below error.

C:\Users\NADIM AKTHAR>aws ec2 run-instances --image-id ami-0447a12f28fddb066 --instance-type t2.micro --count 1 --subnet-id subnet-51167d1d --key-name key123.pem
An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair 'key123.pem' does not exist

How can I solve this error?

Jun 2, 2020 in AWS by akhtar
• 38,260 points
6,040 views

1 answer to this question.

0 votes

Hi@akhtar,

In your command don't use .pem extension in your key. AWS stores key without any extension. Otherwise you will get this error.

answered Jun 2, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

Using Shapely on AWS Lambda with Python 3

For some reason, the pip install of ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 58,100 points
2,938 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP