[cs615asa] EC2_BACKUP_FLAGS_AWS question

Jan Schaumann jschauma at stevens.edu
Fri Apr 10 21:15:05 EDT 2015


wzhang32 <wzhang32 at stevens.edu> wrote:

> But if we need ssh to the instance we create, we need --key-name and  
> --security-group.

You don't.  If your ssh configuration is not set to use the default key,
then you'd have to set the EC2_BACKUP_FLAGS_SSH environment variable, as
shown in the examples section of the manual page.

If the user did not specify EC2_BACKUP_FLAGS_AWS and the default
security group does not allow ssh connections, then your attempt to ssh
to the host will fail, and your program should handle that case just as
it should the case of ssh failing for any other reason.

Now it's possible that the way that _you_ have AWS and ssh configured
_you_ would need to specify EC2_BACKUP_FLAGS_AWS="--key-name foo
--security-group bar" and EC2_BACKUP_FLAGS_SSH="-i ~/.ssh/foo", but that
does not hold for all possible users of your program.

The objective is for you to write a general purpose tool, not one that
is written only for the environment of the person who wrote the tool, so
you need to allow for sane defaults and honor these environment
variables.  They are not, however, mandatory.

-Jan


More information about the cs615asa mailing list