AWS¶
Profile Switching¶
af — Interactive Profile Switcher¶
The primary way to switch AWS profiles:
- Presents all AWS profiles via fzf
- Exports
AWS_PROFILE - Checks if the session is valid (
sts get-caller-identity) - If expired, triggers
aws sso login - Displays account info on success
Quick Aliases¶
| Alias | Action |
|---|---|
afc |
Clear all AWS env vars |
afp |
Print current AWS profile |
CLI Aliases¶
Custom AWS CLI aliases are defined in ~/.aws/cli/alias:
Identity¶
Profiles¶
Parsed from ~/.aws/config, showing SSO account and role alongside each name:
aws profile-list # name / sso_account_id / sso_role_name, aligned
aws profile-pick [query] # same list through fzf, prints the name only
export AWS_PROFILE=$(aws profile-pick)
Use af to switch and handle SSO login - an aws alias runs in a subprocess and
cannot change the current shell.
EKS¶
aws eks-list [region] # List clusters
aws eks-update [region] # Pick a cluster (fzf) and update kubeconfig
EKS_ROLE_ARN=$(aws role-pick eks) aws eks-update # cross-account: kubectl assumes that role
Role Assumption¶
Shell functions (dot_config/zsh/functions/general.zsh), not CLI aliases: the
credentials have to land in the current shell, and aws aliases run in a subprocess.
aws-assume # pick a role with fzf, export its credentials
aws-assume arn:aws:iam::123:role/X # or pass the ARN
aws-unassume # drop the credentials, restore AWS_PROFILE
Max Pods Calculator¶
Calculates the maximum number of pods for an EKS node based on instance type, CNI version, and prefix delegation settings.