feat: aws helpers in zshrc - #8
Open
body-clock wants to merge 1 commit into
Open
body-clock wants to merge 1 commit into
body-clock wants to merge 1 commit into
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aws-profile [name]— print or setAWS_PROFILE, so switching identity mid-session does not need a hand-typed export.aws-whoami—sts get-caller-identityin 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.Review notes
alias aws-whoami "aws --output yaml sts get-caller-identity", which zsh rejects — the definition exits 1 and no alias is created (zsh -f -c 'alias foo "echo hi"'; echo $?→1;alias fooprints nothing). It isalias aws-whoami="..."here, verified withalias aws-whoamiafter sourcing the file. Push back if the space form was deliberate.~/.cdl-ssm-utilis not a stow package in this repo, so thesourceline is a hard dependency on a directory that only exists on this machine: on a fresh machine zsh reports a missing file at startup. Left as written — say the word and I will guard it with[[ -f ... ]].Verification
zsh -nclean; sourcingzsh/.zshrcinto azsh -cgivesaws-profileas a function, prints an empty value whenAWS_PROFILEis unset, sets and prints it otherwise.Overlap with an open PR
Open PR #2 also edits
zsh/.zshrc(sources~/.config/fzf/tinted.shjust above the p10k block this PR works below). Different lines, but close enough that the second one to land will want a rebase.