I recently ran into a couple of issues with the AWS CLI and ZSH on my Macbook.
I installed the AWS CLI with Pip and it seemed to be working as expected after the configuration.
The first issue I ran into was trying to setup the command completion with ZSH. After adding
source /usr/local/bin/aws_zsh_completer.sh to my .zshrc file I got an error:
complete:13: command not found: compdef.
I found a few results with no context, or relating to oh-my-zsh, and ZSH on an EC2 instance, but nothing that really helped.
Eventually I re-ran the ZSH New User Install Script,
autoload -U zsh-newuser-install zsh-newuser-install -f
and making sure to include the options for auto completion which got things working. I think that for whatever reason in my old .zshrc file compinit wasn't loading properly.
After that I ran into another error:
zsh compinit: insecure directories, run compaudit for list. Ignore insecure directories and continue [y] or abort compinit [n]?
This was a little easier to resolve and came down to permissions on the files as documented in this Stack Overflow answer.
cd /usr/local/share/ sudo chmod -R 755 zsh sudo chown -R root:staff zsh
Finally everything was working as expected.