[cs615asa] Creating KeyPair and Security Group on-the-fly

Jan Schaumann jschauma at stevens.edu
Thu Mar 27 12:36:17 EDT 2014


Nick Smith <nsmith1 at stevens.edu> wrote:
> Being as we've been fighting with getting the KeyPair + Security Group  
> to work, and I think we settled on getting it from EC2_BACKUP_FLAGS_AWS,  
> I decided to implement a no-nonsense approach to skip this problem. We  
> only need to connect to an instance briefly before it is destroyed, so  
> we can simply create a KeyPair and Security Group on-the-fly to use with  
> the remote instance, and then forget about the KeyPair when we're done.  

Yep, that works.

Often times the right answer to solve a problem is to not have it in the
first place, so good call.

Just make sure to handle the failure cases reliably such that at the end
the keypair is removed.  Ie, you do not want to end up with hundreds of
keypairs if you use your program regularly.

-Jan


More information about the cs615asa mailing list