aws: error: argument ☁️ AWS

aws: error: argument command: Invalid choice / Unknown options

The AWS CLI doesn’t recognise the command or option — usually CLI v1 vs v2 differences, an old CLI version, or a typo.

Seen on: AWS

Meaning

New services and flags need a recent CLI. CLI v2 changed some behaviours (binary format, paging, pip install vs installer). An old aws on the PATH can shadow the new one.

Common causes

  • CLI too old for the service/command
  • v1 installed instead of v2
  • Typo or wrong subcommand order
  • Old binary earlier on PATH

⚡ Quick fix

  1. Check aws --version and which -a aws
  2. Install/upgrade CLI v2
  3. Read aws <service> help for valid options

Detailed fix by platform

Shell

  1. bash
    aws --version
    which -a aws
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip && unzip -q awscliv2.zip && sudo ./aws/install --update

How to diagnose

  1. Version — aws --version
  2. PATH — which -a aws

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.