adding a test

Adding a test.
Separating ec2-specific code, from the rest.