Elastic beanstalk still provisions EC2 instances and an SSH key can be assign to them.
You have two options if you didn't attach a key to an instance at provision time or have since lost it.
- Provision a new instances with a key attached to it.
- Snapshot the instance, Provision a new instances with a key attached and references the snapshot id of the old instance.
One should be easier with Elastic Beanstalk, just provision a new environment with keys attached to the instance, you will lose data with this method though.
More in depth steps for #2 can be found here
. This will help you retain data if need be.
eb ssh only works if you have the keys and have attached them to the instance. Private key files must be located in a folder named .ssh under your user directory
eb init will ask if you want to ssh into your instance, then list out the keys in your account in that region. If a new key was created it should have outputted where the key was place on your filesystem.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-init.html
eb create has a -k key option as well
If you include this option with the eb create command, the value you provide overwrites any key name that you might have specified with eb init.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html