Bird
0
0

Which AWS CLI command correctly creates a new key pair named MyKey and saves the private key to a file?

easy📝 Configuration Q12 of 15
AWS - EC2 Fundamentals
Which AWS CLI command correctly creates a new key pair named MyKey and saves the private key to a file?
Aaws ec2 create-key-pair --key-name MyKey --query 'KeyMaterial' --output text > MyKey.pem
Baws ec2 create-key-pair MyKey > MyKey.pem
Caws ec2 generate-key-pair --name MyKey > MyKey.pem
Daws ec2 new-key --key-name MyKey > MyKey.pem
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct AWS CLI syntax

    The correct command uses create-key-pair with --key-name and outputs the private key material.
  2. Step 2: Confirm output redirection

    The private key is saved by redirecting the output to a file with > MyKey.pem.
  3. Final Answer:

    aws ec2 create-key-pair --key-name MyKey --query 'KeyMaterial' --output text > MyKey.pem -> Option A
  4. Quick Check:

    Correct AWS CLI syntax for key pair creation [OK]
Quick Trick: Use create-key-pair with --query 'KeyMaterial' to save private key [OK]
Common Mistakes:
  • Using wrong command like generate-key-pair
  • Omitting --query to extract key material
  • Not redirecting output to save private key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes