CSE 291 AWS tutorial/walk-through
2018 April 30: AWS tutorial/walk-through

Steps to launch AWS instances

  • Log in to AWS console

    • Log in to https://awsed.ucsd.edu/.
    • You should see a list of classes, select “CSE291_SP18_C00”. List of Classes
    • If you are asked to select a role, you should select “CSE291_SP18_C00_student”; otherwise, you should be in AWS console. Select a role
    • You should see something like this once you are logged in to AWS console. AWS Console
  • Launch AWS instance

    • Click the blue “Launch Instance” button.
    • Step 1: Choose an Amazon Machine Image (AMI): Choose the first one in the list “Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type”
    • Step 2: Choose an Instance Type: Keep the default “t2.micro” type, then click next.
    • Step 3 through step 5: you don’t need to change the settings; simply click next.
    • Step 6: Configure Security Group: You need to select an existing security group and choose sg-b3b4e1cd cse124/291c-sp18 UCSD CSE 124/291C SP18 HW3 Security Group. This will open up SSH access (TCP port 22) as well as TCP and UDP ports 8000 to 9000, which you can use for RPC. Security Group
    • Step 7: Review Instance Launch: Simply click “Launch” to start your new instance. You will see a warning saying “Improve your instances’ security. Your security group, cse124/291c-sp18, is open to the world.”, but that’s intentional. Launch Instance
    • Now you will see a popup diaglog asking you to “Select an existing key pair or create a new key pair”. This will be the SSH key you’ll use later to connect to the VM. Note that you will only be able to download it once.
      • If this is the first instance you are launching, then you need to choose “Create a new key pair”, choose a meaningful name like “cse291c-hw2-userid-region” and download it. Create Key Pair
    • After you successfully launch the instace, you can click the instance id or go back to AWS console. You should be able to see the instance in the list. Instance List
  • Switch Region

    • For this assignment, you need to create VMs in the following regions:
      • Seoul
      • Ireland
      • Sao Paulo
      • Mumbai
    • To switch region, click the middle dropdown menu in the upper right corner, which shows the current region and defaults to Oregon, and then click the new region. Switch Region
    • You will need to repeat the “Launch AWS Instance” steps above.
  • Connect to the VM

    • You need the following to SSH into your VM:
      • The key pair downloaded from AWS console, e.g. cse291c-hw2-yig004-oregon.pem
      • The instance public DNS or public IP, which you can find out in instance details, e.g. ec2-34-217-75-133.us-west-2.compute.amazonaws.com or 34.217.75.133 Instance Details
    • You might need to change the permissions of your key file so SSH client doesn’t warn you (something like “WARNING: UNPROTECTED PRIVATE KEY FILE!“). To fix this warning, change the permission of the file to 0400 (readable by user only):

    chmod 400 .ssh/cse291c-hw2-yig004-oregon.pem * You can run the following command to SSH into your VM, assuming your key pair file (i.e. .pem file) is in .ssh directory:

    ssh -i .ssh/cse291c-hw2-yig004-oregon.pem ec2-user@ec2-34-217-75-133.us-west-2.compute.amazonaws.com

    Be sure to replace the key file name and the DNS name with yours.

  • Stop your VM

    • When you are done with your experiments, please stop (shut down) them to save costs. Each student is allocated a fixed amount of credit and keeping the VMs running will cost money.
    • To stop the VM, select the instance(s) in the list, and click “Actions” -> “Instance State” -> “Stop”. Stop Instance
    • You do not need to terminate the VM, and you are not allowed to do so as configured by ACMS.