1
0
Эх сурвалжийг харах

bin: add rough aws-vault support to aws-web-login

Thomas Dy 1 жил өмнө
parent
commit
965d3802e1

+ 9 - 1
.local/bin/aws-web-login

@@ -24,8 +24,16 @@ urlencode() {
   done
 }
 
+get-credentials() {
+  if command -v aws-vault > /dev/null; then
+    aws-vault export --format=json --duration=8h "$profile-raw"
+  else
+    get-aws-login --profile "$profile" --duration 43200 --output credential_process
+  fi
+}
+
 container=$(container_name)
-credentials=$(get-aws-login --profile "$profile" --duration 43200 --output credential_process | jq -c \
+credentials=$(get-credentials | jq -c \
   '{
     sessionId: .AccessKeyId,
     sessionKey: .SecretAccessKey,