Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function oc-ips {
- aws_profile=${1:-test}
- cluster_name=$(sed -n 's/cluster=cluster_config-\([^\.]\+\)\.json/\1/p' .ocopsworks.rc)
- aws --profile $aws_profile ec2 describe-instances \
- --output text \
- --filters "Name=tag:opsworks:stack,Values=$cluster_name" \
- --query "Reservations[].Instances[].[Tags[?Key=='opsworks:instance']|[0].Value,PublicIpAddress]" \
- > .oc-ips
- }
- function ssh_to {
- hostname=$1
- ip=$(grep "^$hostname" .oc-ips | cut -f 2)
- ssh -A -t $ip
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement