wsl 2 and ec2 instance connect aws cli command issues

0

Hi all, i am facing an issue trying to configure ec2 instance connect, i am using wsl 2 and getting 2 outputs that concern me, the first is:

aws: error: argument operation: Invalid choice, valid choices are:

which shouldnt be there because i got aws cli installed successfully, i even verified with the aws s3 ls command, plus the aws --version returns output

% aws --version
aws-cli/2.5.8 Python/3.9.11 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off

and the

kex_exchange_identification: Connection closed by remote host

which i have no clue what it means, can someone help me please?

Full output below:

xyz@xps-win ~/.ssh % ssh -i xyz.pem ec2-user@i-xyz\
    -o ProxyCommand='aws ec2-instance-connect open-tunnel --instance-id i-xyz'

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

kex_exchange_identification: Connection closed by remote host

Thanks!

Borch
asked a year ago560 views
1 Answer
1

Hello.
I think the version of AWS CLI is out of date.
Please follow the steps in the following document to upgrade.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"  
unzip awscliv2.zip
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions