Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
nvbalfieri committed Feb 3, 2019
1 parent f41f17e commit fe1cdfa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,10 @@ owner_images # get ami-nnn ids of all created images
<p>
Note that snapshots do not consume extra space. Amazon implements them using copy-on-write, so new space is allocated only when blocks are
changed in one of the volumes (snapshot or other).</p>

<p>
<pre>
create_inst # create 1 on-demand instance using master instance type, etc.
create_inst t2.nano # same, but override instance type
create_insts 5 # create 5 on-demand instances
create_insts 5 m3.medium # same, but override instance type
8 changes: 2 additions & 6 deletions create_inst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
use strict;
use warnings;

my $type = shift @ARGV || `inst_type`;
my $image = shift @ARGV || `owner_image`;
my $key = shift @ARGV || `inst_key`;
my $group = shift @ARGV || `owner_group`;
my $region = shift @ARGV || `owner_region`;
system( "aws ec2 run-instances --image-id ${image} --count 1 --instance-type ${type} --key-name ${key} --security-group-ids ${group} --region ${region}" );
my $args = join( " ", @ARGV );
system( "create_insts 1 ${args}" );
12 changes: 12 additions & 0 deletions create_insts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/perl -w
#
use strict;
use warnings;

my $count = shift @ARGV || die "ERROR: create_insts <cnt>\n";
my $type = shift @ARGV || `inst_type`;
my $image = shift @ARGV || `owner_image`;
my $key = shift @ARGV || `inst_key`;
my $group = shift @ARGV || `owner_group`;
my $region = shift @ARGV || `owner_region`;
system( "aws ec2 run-instances --image-id ${image} --count ${count} --instance-type ${type} --key-name ${key} --security-group-ids ${group} --region ${region}" );

0 comments on commit fe1cdfa

Please sign in to comment.