0
0
AWScloud~10 mins

Key pairs for SSH access in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new EC2 key pair using AWS CLI.

AWS
aws ec2 create-key-pair --key-name [1]
Drag options to blanks, or click blank then click option'
AMyKeyPair
BInstanceId
CSecurityGroup
DSubnetId
Attempts:
3 left
💡 Hint
Common Mistakes
Using resource IDs instead of a key pair name
Omitting the --key-name option
2fill in blank
medium

Complete the code to specify the output format as JSON when creating a key pair.

AWS
aws ec2 create-key-pair --key-name MyKeyPair --output [1]
Drag options to blanks, or click blank then click option'
Atext
Bjson
Ctable
Dcsv
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'table' instead of 'json' for output format
3fill in blank
hard

Fix the error in the command to import an existing public key to AWS as a key pair.

AWS
aws ec2 import-key-pair --key-name MyImportedKey --public-key-material fileb://[1]
Drag options to blanks, or click blank then click option'
Amykey.pem
Bmykey.txt
Cmykey.key
Dmykey.pub
Attempts:
3 left
💡 Hint
Common Mistakes
Using private key files instead of public key files
Omitting the fileb:// prefix
4fill in blank
hard

Fill both blanks to create a key pair and save the private key to a file.

AWS
aws ec2 create-key-pair --key-name [1] --query 'KeyMaterial' --output text > [2]
Drag options to blanks, or click blank then click option'
AMyNewKey
BMyKeyPair
Cmynewkey.pem
Dmykeypair.pem
Attempts:
3 left
💡 Hint
Common Mistakes
Saving the private key to a file without .pem extension
Using mismatched names
5fill in blank
hard

Fill all three blanks to launch an EC2 instance using a key pair and specify the instance type.

AWS
aws ec2 run-instances --image-id ami-12345678 --count 1 --instance-type [1] --key-name [2] --security-group-ids [3]
Drag options to blanks, or click blank then click option'
At2.micro
BMyNewKey
Csg-0a1b2c3d4e5f6g7h
Dm5.large
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid instance types
Omitting the key pair name
Using incorrect security group IDs