Skip to content

AWS Account Quickstart

Scott Sievert edited this page Feb 17, 2017 · 1 revision

The purpose of this quickstart is to clearly outline the steps involved in creating an AWS account from scratch, and obtaining the all of the account information and secure access keys necessary for launching NEXT. AWS provides their own getting started guide, so users should refer here for a more in-depth introduction to AWS as desired.

Major Concepts

  • Key-pair/Identity File - An SSH private key file.
  • Key-pair name - Name of private key file on EC2.

Create an account and an IAM user

  1. Go to http://aws.amazon.com/ and click Sign Up.

  2. Follow the on-screen instructions until you are logged into the AWS console.

Summary

Running the below will get you set up to run NEXT experiments. Each step is described in detail below.

export AWS_ACCESS_KEY_ID=[access-key]
export AWS_SECRET_ACCESS_KEY=[secret-key]
export KEY_FILE=/Users/scott/Classes/security/AWS/next_key_scott.pem  # the path to the key
export KEY_PAIR=next_key_scott  # the key I downloaded is next_key_scott.pem
export AWS_BUCKET_NAME=[buckid]

Running these commands will get you setup to use NEXT, and prepared to run the examples.

Create an access key

  1. Go to the Security Credentials in the dropdown under your name.

    Imgur

  2. Click on the Access Keys (Access Key ID and Secret Access Key) tab.

    Imgur

  3. Click the create new access key button. In the corresponding pop-up, click show access keys. Write your Access Key ID and Secret Access Key down or save them to a secure location for later reference.

Create a key pair

  1. Go to the AWS EC2 console.

  2. Click on Security Groups in the left navbar.

    Imgur

  3. Click Create Key Pair and download your private .pem key file. Then use the following command to set the permissions of your private key file so that only you can read it:

    $ chmod 400 [my_private_key_name].pem
    

Test it out

We now have all of the AWS credentials we need to launch NEXT. But before we launch NEXT we need to create an S3 bucket on AWS, where all experiment backups will be stored.

If you haven't already, clone the repo and install the local requirements using:

$ git clone https://github.com/nextml/NEXT.git
$ cd NEXT
$ sudo pip install -r local_requirements.txt

Then set your AWS Access Key ID and Secret Access Key as local environment variables using:

$ export AWS_SECRET_ACCESS_KEY=[your_secret_aws_access_key_here]
$ export AWS_ACCESS_KEY_ID=[your_aws_access_key_id_here]

Now we can use the createbucket command to create our bucket:

$ cd ec2
$ python next_ec2.py --key-pair=[keypair] --identity-file=[key-file] createbucket [cluster-name]

where:

  • [keypair] is the name of your EC2 key pair
  • [key-file] is the private .pem key file for your key pair
  • [cluster-name] is the custom name you create and assign to your cluster

This will print out another environment variable command, export AWS_BUCKET_NAME=[bucket_uid].

Once it does, navigate to the S3 Management Console and verify that a bucket named [bucket_uid] from above created.

Imgur

Than we run export NEXT_BACKEND_GLOBAL_HOST=[public-dns] where [public-dns] can be found at AWS > EC2 > [click on launched instance] > Public DNS (it's viewable in the footer/menu for the instance).

Once this is done, we are ready to run the examples found in NEXT/examples.

Clone this wiki locally