Score:1

Can't use execute-command --interactive in AWS CLI session manager

cz flag

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?

Score:3
jp flag

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

HDuck avatar
cz flag
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.
Score:1
cd flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.