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,180 points

1 answer to this question.

0 votes


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,220 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,120 points
0 votes
1 answer
0 votes
1 answer