I followed this guide (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/permissions-for-ec2-instance-connect-endpoint.html). I can connect to the instance using the console but can't connect using AWS CLI. This is the output I get.
aws ec2-instance-connect ssh --instance-id i-0daa56a4c6ce5578d
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
send-ssh-public-key | send-serial-console-ssh-public-key
help
When I use the valid choices provided above, this is what I get
aws ec2-instance-connect send-ssh-public-key --instance-id i-0daa56a4c6ce5578d --availability-zone us-east-1a --instance-os-user ec2-user --ssh-public-key file://my_key.pub
{
"RequestId": "fa460a07-0df4-4886-bcc0-7eaf808f3cf6",
"Success": true
}
Where should I go from here?