aws-cli: Updated the config with tools for saml login

This commit is contained in:
Gregor Bückendorf 2019-05-17 23:07:51 +02:00
parent 373652f6b9
commit 927e0c5407
4 changed files with 32 additions and 7 deletions

View file

@ -0,0 +1,17 @@
# If aws-azure-login is not installed do nothing
if ! command -v aws-azure-login >/dev/null 2>&1
then
return
fi
# In WSL the no-sandbox parameter is mandatory for aws-azure-login to function
# correctly
if truthy $DOTFILES_WSL
then
alias aws-azure-login="aws-azure-login --no-sandbox"
fi
# Make it so I just have to type a command and the (optionally) a profile
function aws-token {
aws-azure-login --no-prompt ${1:+--profile $1}
}

View file

@ -32,18 +32,18 @@ if [[ $checksum != $DOTFILES_INSTALL_CHECKSUM ]]; then
echo "Dotfiles: Downloading vim-plug..."
if curl \
--fail \
--location \
--retry 5 \
--retry-delay 1 \
--location \
--retry 5 \
--retry-delay 1 \
--create-dirs \
--progress-bar \
--progress-bar \
--output ~/.local/share/nvim/site/autoload/plug.vim \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
then
echo "Dotfiles: Done"
else
echo "Dotfiles: Error downloading vim-plug"
dotfiles_install_error="yes"
dotfiles_install_error="yes"
fi
fi

View file

@ -1,3 +1,5 @@
AWS_PROFILE=default-role
AWS_DEFAULT_REGION=eu-west-1
AWS_DEFAULT_REGION=eu-central-1
AWS_DEFAULT_OUTPUT=json
AZURE_APP_ID_URI=https://signin.aws.amazon.com/saml
AZURE_DEFAULT_DURATION_HOURS=12

6
.environment.d/wsl.env Normal file
View file

@ -0,0 +1,6 @@
if [[ $OSTYPE == linux-gnu && $(< /proc/sys/kernel/osrelease) == *Microsoft ]]
then
DOTFILES_WSL=true
else
DOTFILES_WSL=false
fi