Skip to content

Commit

Permalink
Add test.env
Browse files Browse the repository at this point in the history
  • Loading branch information
ddriddle committed Mar 16, 2023
1 parent 824193f commit 91111b2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test.env
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"

0 comments on commit 91111b2

Please sign in to comment.