Amazon EC2 Setup

Register at http://aws.amazon.com

Deal with security:

  • Generate and download your X.509 certificate private key and public key pair
  • Put them into folder. ie ~/.ec2
  • In your .bash_profile:
  • export EC2_CERT=...
    export EC2_PRIVATE_KEY=...
    

    Download the EC2 tools at http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&categoryID=88
    Unzip them into a folder and set the path in your .bash_profile

    export EC2_HOME=...

    Add a private key
    ec2-add-keypair [yourname]-keypair
    find the ami id of the image you want to use:
    ec2-describe-images -x all
    Type in
    ec2-run-instances [ami-id-here] -k [yourname]-keypair
    Type in to see your recently created instance.
    ec2-describe-instances

    Allow ssh and public web access.

    ec2-authorize default -p 22
    ec2-authorize default -p 80
    
    You can ssh into the instance:
    ssh -i [yourname]-keypair root@ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
    

    Turn it off using

    ec2-terminate-instances [i-instance_id]