[cs615asa] Region issues

Jan Schaumann jschauma at stevens.edu
Sun Mar 30 11:45:05 EDT 2014


Nicholas Bevacqua <nbevacqu at stevens.edu> wrote:

> Unfortunately, Amazon has also decided that not only should people not
> have the same mappings, but they should even lack mappings on some
> accounts. One of my team-mates was unable to find us-east-1c. I,
> similarly, can't find us-east-1a.
 
Interesting.  I had not seen this before.

> Rather than just set a default region, I implore everyone to check what
> regions are actually available at startup. Otherwise, you might have an
> issue if you picked a region the professor has no access to for a default
> setting.

For whatever it's worth, here are the regions I currently see:

$ aws ec2 describe-regions | awk '{print $NF}' | sort               
ap-northeast-1
ap-southeast-1
ap-southeast-2
eu-west-1
sa-east-1
us-east-1
us-west-1
us-west-2
$ 

Note that there is a difference between a 'region' and an 'availability
zone':

$ aws ec2 describe-availability-zones --region us-east-1 | \
        awk '{print $NF}' | sort
us-east-1a
us-east-1b
us-east-1c
us-east-1d
us-east-1e
$ 

See also:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html


In any case, there are a few cases that you need to consider and handle
gracefully:

You may have an AMI hard-coded that you use to create new instances.
This is the easiest for you, and perfectly fine for this assignment.
However, if you do not control the AMI (ie, you did not create it and
make it available in AWS), then this AMI might disappear at any point.
Your program should fail gracefully here.

You may also consider searching for a suitable AMI rather than hard code
the id.  This would make your program more resilient/future-proof, but
is not necessary for this assignment.

If the user specified a volume, then you probably want to identify the
region in which this volume resides.  If you hardcode the AMI, then you
should check if the volume is in the right region/zone; if it is not,
then you need to fail and let the user know that (and why) the given
volume can't be used.


I'm glad to see that you are identifying these sorts of issues and are
thinking about how to solve them.  These are exactly the sort of thing
that can only be discovered by working on the project, and that I can't
help you with beforehand, as the API and tools are changing from year to
year.

-Jan


More information about the cs615asa mailing list