-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 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,32 @@ | ||
# usage: source test.env | ||
# | ||
# Sets up a tempory directory & environment variables for testing | ||
# aws login | ||
|
||
disable () { | ||
unset AWS_CONFIG_FILE | ||
unset AWS_SHARED_CREDENTIALS_FILE | ||
unset AWSCLI_LOGIN_ROOT | ||
rm -rf $AWSCLI_LOGIN_ROOT | ||
|
||
unalias aws | ||
unalias login | ||
|
||
unset -f disable | ||
} | ||
|
||
export AWSCLI_LOGIN_ROOT=`mktemp -d` | ||
export AWS_CONFIG_FILE="$AWSCLI_LOGIN_ROOT/.aws/config" | ||
export AWS_SHARED_CREDENTIALS_FILE="$AWSCLI_LOGIN_ROOT/.aws/credentials" | ||
|
||
aws configure set plugins.login awscli_login.plugin | ||
aws login configure >/dev/null <<- EOF # NOTA BENE: <<- strips tabs | ||
https://localhost:8443/idp/profile/SAML2/SOAP/ECP | ||
user01 | ||
|
||
push | ||
|
||
EOF | ||
|
||
alias login="login --sts-endpoint-url=http://localhost:5000 --verify-ssl-certificate=false" | ||
alias aws="aws --endpoint-url=http://localhost:5000" |