Skip to content

Commit 95aa744

Browse files
committed
uvault
1 parent 7520f4e commit 95aa744

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.bashrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,23 @@ function releaseCommits() {
10561056
echo " https://github.com/ConsultingMD/jarvis/compare/${lastReleaseBranchWithoutRemote}...${currentReleaseBranchWithoutRemote}"
10571057
}
10581058

1059+
function uvault() {
1060+
uat && \
1061+
echo '🌐 Opening SSH tunnel named "my-vault-tunnel" in background...' && \
1062+
ssh -M -S my-vault-tunnel -fnNT -L "1234:vault.$(aws-environment).grandrounds.com:443" "$GR_USERNAME@$HOST" && \
1063+
ssh -S my-vault-tunnel -O check "$GR_USERNAME@$HOST" && \
1064+
sleep 5 && \
1065+
echo '🔐 Use this token to log in:' && \
1066+
(aws-environment infra-uat developer && \
1067+
VAULT_ADDR=https://localhost:1234 vault login -tls-skip-verify -token-only -method=aws role=developer) && \
1068+
open 'https://localhost:1234/ui/vault/auth?with=token' && \
1069+
echo '✅ Run kvault this command to close the tunnel'
1070+
}
1071+
1072+
function kvault() {
1073+
ssh -S my-vault-tunnel -O exit "$GR_USERNAME@$HOST"
1074+
}
1075+
10591076
function jgrep() {
10601077
#bundle exec rake routes > ~/dev/rake-routes
10611078
cat ~/dev/rake-routes | grep "$1"

0 commit comments

Comments
 (0)