From 5363334ce10568fcfdc46153cc65914f3987c25a Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 25 Sep 2026 17:08:40 -0400 Subject: [PATCH] feat: aws helpers in zshrc - aws-profile [name]: print or set AWS_PROFILE, so switching identity mid session does not need a hand-typed export line. - aws-whoami: sts get-caller-identity in yaml, to confirm which identity a profile actually resolves to before touching anything. - source ~/.cdl-ssm-util/session-zsh-snippet.sh: session helper that ships with the cdl-ssm-util checkout. Depends on ~/.cdl-ssm-util existing. It is not a stow package in this repo, so on a machine without that checkout zsh reports a missing file at startup. The alias was written in the space form (`alias aws-whoami "..."`), which zsh rejects: the definition exits 1 and no alias is created. It is `name="value"` here, verified with `alias aws-whoami` after sourcing. --- zsh/.zshrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/zsh/.zshrc b/zsh/.zshrc index b425ce7..fa7a122 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -38,5 +38,18 @@ source <(fzf --zsh) # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# get/set AWS_PROFILE env var +aws-profile () { + if [ $# -gt 0 ]; then + export AWS_PROFILE=$1 + fi; + echo $AWS_PROFILE +} + +source ~/.cdl-ssm-util/session-zsh-snippet.sh + +# print current aws session identity +alias aws-whoami="aws --output yaml sts get-caller-identity" + # agent-sync export PATH="/Users/pperkins/dotfiles/agents/bin:$PATH"