Skip to content

Instantly share code, notes, and snippets.

@AbirRazzak
Last active August 15, 2023 20:09
Show Gist options
  • Save AbirRazzak/9e77e2ba56a6e904f88b5ffd04210f6d to your computer and use it in GitHub Desktop.
Save AbirRazzak/9e77e2ba56a6e904f88b5ffd04210f6d to your computer and use it in GitHub Desktop.
AWS Auth Functions for Oh My Zsh Profile
# Use `auth` to refresh or use new AWS credentials for the current terminal instance
auth() {
aws configure sso
eval "$(aws configure export-credentials --profile default --format env)"
}
# Use `setauth` to set current AWS session to current terminal instance
# Helpful when you've already auth'ed in a different terminal instance
setauth() {
eval "$(aws configure export-credentials --profile default --format env)"
}
export AWS_DEFAULT_REGION='us-east-1'
export AWS_PROFILE='default'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment