From 21a8089908d6060fdfcf94ec13aa51492041fe7b Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Mon, 4 Sep 2023 09:45:41 +0200 Subject: [PATCH] Improved region support on awsprofile --- zsh.d/zshfunctions/awsprofile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zsh.d/zshfunctions/awsprofile b/zsh.d/zshfunctions/awsprofile index 1b3e985..a371db6 100644 --- a/zsh.d/zshfunctions/awsprofile +++ b/zsh.d/zshfunctions/awsprofile @@ -3,6 +3,15 @@ profile=$1 region=${1:-""} +declare -A symRegions +symRegions[ire1]='eu-west-1' +symRegions[fra1]='eu-central-1' +symRegions[ohio1]='us-east-2' + +lookup_region=${symRegions[$region]} + +[ -z $lookup_region ] || region=${lookup_region} + if [ ! -f ~/.aws/config ]; then echo "no aws config file found, bailing out..." return 1