diff --git a/.bashrc.d/aws-azure-login.sh b/.bashrc.d/aws-azure-login.sh new file mode 100644 index 0000000..07cd9e2 --- /dev/null +++ b/.bashrc.d/aws-azure-login.sh @@ -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} +} diff --git a/.bashrc.d/dotfiles_install.sh b/.bashrc.d/dotfiles_install.sh index ebe5b50..9258d2b 100644 --- a/.bashrc.d/dotfiles_install.sh +++ b/.bashrc.d/dotfiles_install.sh @@ -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 diff --git a/.environment.d/aws.env b/.environment.d/aws.env index cfe69c1..37a787b 100644 --- a/.environment.d/aws.env +++ b/.environment.d/aws.env @@ -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 diff --git a/.environment.d/wsl.env b/.environment.d/wsl.env new file mode 100644 index 0000000..73d2a29 --- /dev/null +++ b/.environment.d/wsl.env @@ -0,0 +1,6 @@ +if [[ $OSTYPE == linux-gnu && $(< /proc/sys/kernel/osrelease) == *Microsoft ]] +then + DOTFILES_WSL=true +else + DOTFILES_WSL=false +fi