Complete the code to create a new EC2 key pair using AWS CLI.
aws ec2 create-key-pair --key-name [1]The --key-name option specifies the name of the key pair to create. 'MyKeyPair' is a valid name.
Complete the code to specify the output format as JSON when creating a key pair.
aws ec2 create-key-pair --key-name MyKeyPair --output [1]The --output json option formats the command output as JSON, which is easy to parse and read.
Fix the error in the command to import an existing public key to AWS as a key pair.
aws ec2 import-key-pair --key-name MyImportedKey --public-key-material fileb://[1]
The --public-key-material option requires the public key file, usually with a .pub extension.
Fill both blanks to create a key pair and save the private key to a file.
aws ec2 create-key-pair --key-name [1] --query 'KeyMaterial' --output text > [2]
The key pair is named 'MyNewKey' and the private key is saved to 'mynewkey.pem' file.
Fill all three blanks to launch an EC2 instance using a key pair and specify the instance type.
aws ec2 run-instances --image-id ami-12345678 --count 1 --instance-type [1] --key-name [2] --security-group-ids [3]
The instance type is 't2.micro', the key pair name is 'MyNewKey', and the security group ID is 'sg-0a1b2c3d4e5f6g7h'.