Skip to content

Instantly share code, notes, and snippets.

@scalp42
Forked from j3tm0t0/wild1liner.zsh
Created March 19, 2014 22:57
Show Gist options
  • Select an option

  • Save scalp42/9653233 to your computer and use it in GitHub Desktop.

Select an option

Save scalp42/9653233 to your computer and use it in GitHub Desktop.
#!/bin/zsh
VPCID=$(ec2addvpc 10.100.0.0/16 | cut -f 2 ) && sleep 30 | SUBNETA=$(ec2addsubnet -c $VPCID -i 10.100.1.0/24 -z ap-northeast-1a| cut -f 2) && SUBNETB=$(ec2addsubnet -c $VPCID -i 10.100.2.0/24 -z ap-northeast-1b| cut -f 2) && IGW=$(ec2addigw | cut -f 2) && sleep 15 | ec2attigw $IGW -c $VPCID | RTB=$(ec2drtb | grep $VPCID | cut -f 2) | ec2assocrtb $RTB -s $SUBNETA | ec2addrt $RTB -r 0.0.0.0/0 -g $IGW | INSAID=$(ec2run ami-4e6cd34f -k keypair -t t1.micro -s $SUBNETA | grep ^INSTANCE | cut -f 2) && INSBID=$(ec2run ami-4e6cd34f -k keypair -t t1.micro -s $SUBNETB | grep ^INSTANCE | cut -f 2) && EIPASSOS=$(ec2allocaddr -d vpc | cut -f 5) && SG=$(ec2dgrp | grep $VPCID | cut -f 2) && ec2auth $SG -P TCP -p 22 | sleep 30 | ec2assocaddr -a $EIPASSOS -i $INSAID --allow-reassociation | echo DONE!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment