Skip to content

Instantly share code, notes, and snippets.

@j-griffith
Created April 19, 2022 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-griffith/37c63474c4dbd556974188de1ac6256b to your computer and use it in GitHub Desktop.
Save j-griffith/37c63474c4dbd556974188de1ac6256b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Work around dumb ENV var for AWS config settings that are only good in current session
# Messed with env var init tricks, but at the end of the day, just much easier to write
# a proper credentials file out, then it's good for all sessions
# alias `awslogin="aws-login <account> <user> && update-aws-creds.sh"`
cat >~/.aws/credentials <<EOF
[default]
aws_access_key_id=$AWS_ACCESS_KEY_ID
aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
aws_session_token=$AWS_SESSION_TOKEN
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment