Setting up EC2
Note: PoolParty works with ANY ubuntu AMI (support for other OSes is already in progress)
Sign up
- Navigate to Amazon's aws page and click on the Getting started link. If you already have an aws account, log in and skip the next step.
- Sign up and validate your account
-
Once you've signed up or signed in, hover over the product's menu and click on Elastic Computing Cloud.
-
Then, click on the Sign up for Amazon EC2 button to sign up for the ec2 service
-
Now, once you have access to ec2, get your access identifiers by hovering over Your Account in the menu and clicking on Access Identifiers
-
Scroll down the page and find the box titled "Access Key ID and Secret Access Key," In the box, you should see a box titled "Your Access Key ID." Make note of this string.
-
Scroll down a little further and find the box titled "Your Secret Access Key." This box is hidden for security reasons, so you'll have to click on the show link. Make note of this string as well.
Setup
PoolParty expects a number of access identifiers to be in one of several places.
clouds.rb
You can explicitely set them in your clouds.rb like so:
cloud :app do
access_key "AAAAAAAAAABBBBBB"
secret_access_key "NRLSKDM@$@$/4@$%%NNNSN"
# ...
end
Of course, this works if you are going to keep your spec local and private, but that doesn't really work well for sharing, so instead, let's set them as environment variables.
environment variables
Poolparty commands will look for the following AWS environment variables
- EC2_ACCESS_KEY
- EC2_SECRET_KEY
for your AWS access key, secret key, private key & cert, respectively.
Stick this in your ~/.bashrc or ~/.profile. (Alternatively, create a script in ~/.ec2/keys_and_secrets.sh and then source $HOME/.ec2/keys_and_secrets.sh in your ~/.profile)
#!/bin/sh
export EC2_ACCESS_KEY="AAAAAAAAAABBBBBB"
export EC2_SECRET_KEY="NRLSKDM@$@$/4@$%%NNNSN"
export EC2_PRIVATE_KEY="/path/to/pk-XXX.pem"
export EC2_CERT="/path/to/cert-XXX.pem"
Be sure to open a new terminal before you continue so that your changes are re-loaded (or reload your profile from the command-line with
source ~/.profile
).
Keypair
Keypairs are generated automatically for you if your keypair does not exist. The naming
convention is in the format:
[poolname]-[cloudname]
Security groups
Security groups are how the clouds distinguish each other. You can specify security groups in your clouds.rb in the format:
security_group do authorize :from_port => 22, :to_port => 22 endPoolParty will take care of ensuring this security group with the specified ports open as well as it will close the ports that are open that are not specified to keep the security groups declarative. You can also provide a name for the security groups:
security_group "my-custom-named-security-group" do authorize :from_port => 22, :to_port => 22 end
Note, to use the anything command that requires ssh access, you must allow port 22 to be opened in your security_group declaration.
clouds.rb file location
Your clouds.rb must be accessible to the command-line. It will try to require the clouds.rb from the current working directory if the clouds.rb is in the current directory. If it is not, you can specify the location with the -c switch with any cloud command.
cloud show -c examples/simple.rb
The clouds.rb is also "requireable" from ruby, so you can operate with the cloud from irb or any other ruby program, i.e.:
irb -r poolparty/clouds.rb
External links

