ec2-plugin
ec2-plugin copied to clipboard
dynamically create sshKeyPair if one is not supplied via credentials via the configuration
This PR proposes a means of automatically creating an ssh keypair
to use when launching an instance if the user has not manually specified one via the use of credentials in the configuration. This change is backwards compatible with the current behavior - if an ssh credential
is specified in the configuration page then no attempt will be made to use dynamic ssh keys management.
If no ssh private key is configured then the plugin will automatically generate one and then assign it to the instance being launched. The private key and the AWS keyPair
name are persisted as part of the node definition so that it can be used for ssh
connections and also so that the keyPair
can deleted once the node is scheduled for termination.
In the case where the request is made to launch multiple instances from a single template AND dynamic ssh keys are being used then the request to create instances will internally be unrolled into N requests to create N instead of a single request for multiple instances. This is done so that each instance gets its own unique SSH keypair.
Testing done
- [x] manual testing
- [ ] new unit tests
- [x] update docs
Submitter checklist
- [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue