Bird
0
0

You run this command but get an error: InvalidKeyPair.NotFound. What is the likely cause?

medium📝 Debug Q14 of 15
AWS - EC2 Fundamentals
You run this command but get an error: InvalidKeyPair.NotFound. What is the likely cause?
aws ec2 run-instances --image-id ami-87654321 --count 1 --instance-type t3.small --key-name WrongKey --security-groups Default
AThe key pair named 'WrongKey' does not exist in your AWS account
BThe AMI ID is invalid
CThe instance type t3.small is not supported
DThe security group 'Default' is missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error message

    'InvalidKeyPair.NotFound' means the specified key pair is not found in your AWS account.
  2. Step 2: Match error to command parameters

    The key-name 'WrongKey' likely does not exist or is misspelled, causing the error.
  3. Final Answer:

    The key pair named 'WrongKey' does not exist in your AWS account -> Option A
  4. Quick Check:

    InvalidKeyPair error = missing key pair [OK]
Quick Trick: Check key pair name spelling if InvalidKeyPair error occurs [OK]
Common Mistakes:
  • Assuming AMI or instance type caused the error
  • Thinking security group 'Default' is missing
  • Ignoring key pair existence in the region

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes