Tag: cloud
AWS Context Switch with Tab Autocompletion
AWS Context Switch with Tab Autocompletion
This article explains how to create a custom awsctx
command in Zsh to easily switch AWS profiles with tab autocompletion, similar to kubectx
for Kubernetes. It guides you through defining the awsctx
function, enabling Bash-style completion in Zsh using bashcompinit
, and writing a Bash-based completion script that uses compgen
to dynamically suggest AWS profile names. With this setup, users can quickly switch profiles using fuzzy search or direct tab-completion, streamlining AWS CLI workflows.