small pixel drawing of a pufferfish dotfiles

bin/MACC02VK5ECHTD7/j

#!/bin/sh
query="$1"
shift 2> /dev/null

text=$(
    printf "$*" | \
    sed -e 's/bpe/-p browse_prod -r us-east-1/g' | \
    sed -e 's/bpw/-p browse_prod -r us-west-2/g' | \
    sed -e 's/bse/-p browse_stage -r us-east-1/g' | \
    sed -e 's/bsw/-p browse_stage -r us-west-2/g' | \
    sed -e 's/bte/-p browse_test -r us-east-1/g' | \
    sed -e 's/btw/-p browse_test -r us-west-2/g' | \
    sed -e 's/cpe/-p cgraph_prod -r us-east-1/g' | \
    sed -e 's/cpw/-p cgraph_prod -r us-west-2/g' | \
    sed -e 's/cse/-p cgraph_stage -r us-east-1/g' | \
    sed -e 's/csw/-p cgraph_stage -r us-west-2/g' | \
    sed -e 's/cte/-p cgraph_test -r us-east-1/g' | \
    sed -e 's/ctw/-p cgraph_test -r us-west-2/g'
)

ip=$(awless --local list instances --filter state=running,name="$query" $text --format json | jq -r '.[] | [.PrivateIP] | .[]' | head -n1)
/usr/local/bin/ssh "$ip"