1 package Oyster::Provision::AmazonEC2;
7 my $ec2_image_id = "ami-1a837773";
8 my $ec2_username = "AKIAJXSD25MPWFYTQWIQ";
9 my $ec2_password = "m76s9DyoXrHdpVy8HkhjgD0RAjy14bhkQ5Zts/gg";
11 my $ec2 = Net::Amazon::EC2->new(
12 AWSAccessKeyId => $ec2_username,
13 SecretAccessKey => $ec2_password,
16 my $ec2_oyster_key = "OysterDefault";
17 my $key_pairs = $ec2->describe_key_pairs({ KeyName => $ec2_oyster_key });
19 unless(defined($key_pairs)) {
21 print("Creating $ec2_oyster_key key pair\n");
22 $ec2->create_key_pair({ KeyName => $ec2_oyster_key });
33 # Start 1 new instance from AMI: ami-XXXXXXXX
34 my $instance = $ec2->run_instances(
35 ImageId => $ec2_image_id,
36 KeyName => $ec2_oyster_key,
61 Oyster::Provision::AmazonEC2 -- Provision your Oyster on Amazon EC2
65 Use the Rackspace backend on your Oyster configuration file
67 =head1 REQUIRED PARAMETERS
69 The following are required to instantiate a backend:
75 The name of your new/existing rackspace server.
79 The size ID of the rackspace server you want to create.
80 Use the following incantation to see them:
82 perl -MNet::RackSpace::CloudServers -e'
83 $r=Net::RackSpace::CloudServers->new(
84 user=>$ENV{CLOUDSERVERS_USER},
85 key=>$ENV{CLOUDSERVERS_KEY},
88 { "id $_->{id} ram $_->{ram} disk $_->{disk}\n" }
95 id 5 ram 4096 disk 160
96 id 6 ram 8192 disk 320
97 id 7 ram 15872 disk 620
101 The image ID of the rackspace server you want to create.
102 Use the following incantation to see them:
104 perl -MNet::RackSpace::CloudServers -e'
105 $r=Net::RackSpace::CloudServers->new(
106 user=>$ENV{CLOUDSERVERS_USER},
107 key=>$ENV{CLOUDSERVERS_KEY},
110 { "id $_->{id} name $_->{name}\n" }
113 id 29 name Windows Server 2003 R2 SP2 x86
114 id 69 name Ubuntu 10.10 (maverick)
115 id 41 name Oracle EL JeOS Release 5 Update 3
116 id 40 name Oracle EL Server Release 5 Update 4
117 id 187811 name CentOS 5.4
118 id 4 name Debian 5.0 (lenny)
119 id 10 name Ubuntu 8.04.2 LTS (hardy)
120 id 23 name Windows Server 2003 R2 SP2 x64
121 id 24 name Windows Server 2008 SP2 x64
122 id 49 name Ubuntu 10.04 LTS (lucid)
123 id 14362 name Ubuntu 9.10 (karmic)
124 id 62 name Red Hat Enterprise Linux 5.5
128 id 31 name Windows Server 2008 SP2 x86
129 id 51 name CentOS 5.5
130 id 14 name Red Hat Enterprise Linux 5.4
131 id 19 name Gentoo 10.1
132 id 28 name Windows Server 2008 R2 x64
133 id 55 name Arch 2010.05
135 Oyster only supports Linux images, specifically
136 Ubuntu 10.10 (maverick).
140 The public ssh key you would like copied to the
141 new server's C</root/.ssh/authorized_keys> file
142 to allow you to ssh in the box without providing