-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getlogs.sh: allow empty log filters, and handle errors from aws cli b…
…etter.
- Loading branch information
Charles Howes
committed
Sep 26, 2019
1 parent
1420308
commit c9ec606
Showing
2 changed files
with
58 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
if [[ "$1" == "" ]]; then | ||
echo "Usage: eval \$( ${0##*/} aws-profile )" | ||
echo " This script will emit 'export' statements for the AWS CLI to use from the specified profile." | ||
echo "" | ||
echo " export AWS_ACCESS_KEY_ID=....... AWS_SECRET_ACCESS_KEY=........." | ||
exit 1 | ||
fi | ||
|
||
AK=$(aws --profile="$1" configure get aws_access_key_id) || exit 1 | ||
SAK=$(aws --profile="$1" configure get aws_secret_access_key) || exit 1 | ||
|
||
echo "export AWS_ACCESS_KEY_ID=\"$AK\" AWS_SECRET_ACCESS_KEY=\"$SAK\"" |
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