Sha256: 2de1aab219d93e7eb3a584a2d3b63eabaf1bd2939a388ace44fd0ac04995c2cc

Contents?: true

Size: 916 Bytes

Versions: 11

Compression:

Stored size: 916 Bytes

Contents

#!/bin/bash -efu

if [[ -n "${VAGRANT_LOG:-}" ]]; then
  set -x
fi

: ${AWS_TYPE:=m1.large}
: ${AWS_REGION:=us-east-1}
: ${AWS_KEYPAIR:=default}
: ${AWS_BLOCK:=/dev/sda1=:80}
: ${AWS_SHUTDOWN:=terminate}
: ${AWS_QUANTITY:=1}

cmd="$1"; shift
case "$cmd" in
  run-instance)
    image="$1"; shift
    ec2-run-instances -t "$AWS_TYPE" --region "$AWS_REGION" -k "$AWS_KEYPAIR" -b "$AWS_BLOCK" --instance-initiated-shutdown-behavior "$AWS_SHUTDOWN" -n "$AWS_QUANTITY" "$image" | awk '$1 == "INSTANCE" { print $2 }'
    ;;
  terminate-instance)
    instance="$1"; shift
    ec2-terminate-instances "$instance"
    ;;
  ssh-info)
    instance="$1"; shift
    echo "$(ec2-describe-instances "$instance" | awk '$1 == "INSTANCE" && $6 == "running" { print $4 }')" 22
    ;;
  read-state)
    instance="$1"; shift
    ec2-describe-instances "$instance" | awk '$1 == "INSTANCE" { print $6 }'
    ;;
  *)
    exit 1
    ;;
esac

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vagrant-shell-0.2.22 libexec/shell-ec2
vagrant-shell-0.2.21 libexec/shell-ec2
vagrant-shell-0.2.20 libexec/shell-ec2
vagrant-shell-0.2.19 libexec/shell-ec2
vagrant-shell-0.2.17 libexec/shell-ec2
vagrant-shell-0.2.16 libexec/shell-ec2
vagrant-shell-0.2.15 libexec/shell-aws
vagrant-shell-0.2.14 libexec/shell-ec2
vagrant-shell-0.2.13 libexec/shell-ec2
vagrant-shell-0.2.9 libexec/shell-ec2
vagrant-shell-0.2.8 libexec/shell-ec2