Assignment for Week 2: Amazon EC2 instance creation
Description
In this assignment your team will create a few Amazon EC2 virtual
machine instances you'll be using for the rest of the course.
You'll also explore some of the basic properties of an instance.
What you need to do
- Create a key pair for yourself in the EC2 console under "Key
Pairs", giving it a name clearly related to your AWS login name.
Click the "Create Key Pair" button and save the resulting key
pair. Be careful with this file! Do not place it anywhere
where other people can access it. For added protection, encrypt the
private key with a password using "ssh-keygen -p" or the equivalent.
See Amazon
EC2 Key Pairs for more details on how to create and manage a
personal key pair.
- Launch two EC2 instances. Each team member needs to launch at
least one instance. Use these properties for your instances:
- Select the "US West (Oregon)" region in AWS, which is needed
for some of the other things below to be visible. The region menu
is at the upper right of the console page, between your
"user@uo-cis-sysadm-class" menu and the "Support" menu.
- Choose AMI: Use one of the "free tier" Linux machine images.
The most recent Ubuntu OS is recommended.
- Choose Instance Type: t2.nano (it's cheaper than t2.micro even
though only t2.micro is labeled "free tier").
- Configure Instance Details:
- Network: lab-cloud
- Subnet: choose your team's subnet
- Configure Security Group: Use "Select an existing security
group", then select "default (default VPC security group)"
- Once you have selected all of these, you can finally launch
the instance. Make sure to choose your own key pair for access
and not somebody else's.
- Obtain your own public key by logging in to your instance and
getting the contents of the file .ssh/authorized_keys. Add access
for your other team members by adding lines to .ssh/authorized_keys
containing their public keys. You should be careful with this since
you could lock yourself out of your instance if you damage that
file. A recommended process:
- Log in to the session and back up the authorized_keys
file: cp .ssh/authorized_keys authorized_keys_backup
- Edit the .ssh/authorized keys file to add a public key line from
your other team member. Make sure your editor doesn't wrap words or
lines.
- You and your team member should try to initiate separate
logins to the instance to be sure you can both get in.
- If you're not able to get in, use your existing login session
to restore your backup: cp authorized_keys_backup
.ssh/authorized_keys.
What to turn in
Create a subdirectory in your team git repository with the name
"week2" and create files containing your handin materials under
that.
- List the EC2 instance IDs and private IP addresses of all the
instances you created.
- Describe how you find the public IP address of a given instance
using the EC2 console. (The public IP address may change whenever
an instance is stopped and restarted.)
- Provide the output of a command showing how much disk space one
of your instances has.
- Provide the output of a command showing how much memory one of
your instances has.
- Provide a listing showing all the processes running in one of
your instances.
- Provide the output of a command showing the network interface
configuration of your instance (this should show its private IP
address).
- Provide the output of a command showing the routing table of
your instance.
- Provide the output of a command showing all of the open network
connections and ports on one of your instances.
- Provide a listing of all of the software packages installed on
one your instances.
- Provide transcripts showing the output of the commands you use
to update your package database and upgrade packages on each of your
instances.
Material for all of the above should be checked into your team
git repository by class time on Monday, July 8. For an individual
team member to receive credit for the assignment, they must have
made at least one commit.
Class presentation/discussion
On Monday, July 8 we will take some time in class to have everyone
speak briefly about their experience with this assignment.
Evaluation
Each item under "What to turn in" is worth one point.
Steve VanDevender