Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helper/acctest: Add NewSSHKeyPair function (#12894)
Many cloud services prevent duplicate key pairs with different names. Among them are Digital Ocean, Joyent Triton and Packet. Consequently, if tests leave dangling resources it is not enough to simply randomise the name, the entire key material must be regenerated. This commit adds a helper method that returns a new randomly generated key pair, where the public key material is formatted in OpenSSH "authorized keys" format, and the private key material is PEM encoded.
- Loading branch information