Skip to content

Instantly share code, notes, and snippets.

@jrolfs
Last active April 28, 2021 20:14
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 jrolfs/5dfb40c7eba8fd367cebddee8e08706e to your computer and use it in GitHub Desktop.
Save jrolfs/5dfb40c7eba8fd367cebddee8e08706e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo -e "Checking → key: ${1} / secret: ${2}\r"
command="docker run -e AWS_ACCESS_KEY_ID=$1 -e AWS_SECRET_ACCESS_KEY=$2 mikesir87/aws-cli bash -c \"env && echo -e '\n' && aws sts get-caller-identity\""
echo -e "Running:\n\n $command \n"
eval $command
echo -e "\nTimestamp: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"
@jrolfs
Copy link
Author

jrolfs commented Apr 28, 2021

Usage: ./aws-key.sh [KEY] [SECRET]

@jrolfs
Copy link
Author

jrolfs commented Apr 28, 2021

Pipe output to clipboard: ./aws-key.sh [KEY] [SECRET] |& pbcopy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment