2

I'm trying to use the AWS cli + session manager plugin to get into a database container to run some migrations, and I am struggling to get it working. I'm trying to use the following command:

aws ecs execute-command --cluster {cluster}  --task {task} --container {container} --interactive 
 --command "/bin/sh"

And the error message it gives me is: aws.exe: error: argument operation: Invalid choice, valid choices are: along with a list of possible commands to use.

I've also tried running

aws ecs update-service --service {service} --cluster {cluster} --enable-execute-command

and it gives me the error Unknown options: --enable-execute-command. I've also tried these commands with the region parameter included, but it gives me the same error messages. I've tried this all in a few different terminals - bash, powershell, and wsl.

I'm using AWS CLI version 2.0.27, and session manager plugin version 1.2.279.0. Does anyone know what I should try next?

HDuck
  • 123
  • 4

2 Answers2

3

AWS CLI 2.0.27 is 2 years old. You need to update it to get support for new options.

AlexD
  • 8,747
  • 2
  • 29
  • 38
  • I just ran into the same issue again, and ended up finding this post that I had made and forgotten about. Your answer was once again quite helpful, and I wanted to add that I had to install awscli using pip instead of apt to get the latest version. – HDuck Jan 17 '23 at 20:41
1

According to the official doc, you need AWS CLI 2.3.6 or later.

Henry Luo
  • 111
  • 3