small pixel drawing of a pufferfish dotfiles

bin/MACC02VK5ECHTD7/ec2e

#!/bin/sh

query="$1"
shift 2> /dev/null
case "$query" in
	(i-*) filter="id=$query" ;;
	(*) filter="name=$query" ;;
esac

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'
)

awless list instances --columns id,zone,name,state,type,privateip --filter "${filter}" $text