Created
October 24, 2018 02:20
-
-
Save andreas-wilm/732598f065022b1ab88c5aa89d56a39b to your computer and use it in GitHub Desktop.
Populate default AWS profile from CSV
This file contains 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
#!/bin/bash | |
csv=$1 | |
test -z "$csv" && exit 1 | |
test -e "$csv" || exit 1 | |
grep -q '^AccessKeyId' $csv || exit 1 | |
test $(cat "$csv" | wc -l) -eq 2 || exit 1 | |
akid=$(tail -n1 $csv | cut -d',' -f 2) | |
sak=$(tail -n1 $csv | cut -d',' -f 2) | |
aws configure set aws_access_key_id $akid | |
aws configure set aws_secret_access_key $sak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment