Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export public keys from tls_private_key #4606

Merged
merged 1 commit into from
Jan 22, 2016
Merged

Conversation

apparentlymart
Copy link
Contributor

In most cases private keys are used to produce certs and cert requests, but there are some less-common cases where the PEM-formatted keypair is used alone. The public_key_pem attribute supports such cases.

This also includes a public_key_openssh attribute, which allows this resource to be used to generate temporary OpenSSH credentials, so that e.g. a Terraform configuration could generate its own keypair to use with the aws_key_pair resource. This has the same caveats as all cases where we generate private keys in Terraform, but could be useful for temporary/throwaway environments where the state either doesn't live for long or is stored securely.

This builds on the work of @simar7 in #4441, but has changed enough from that patch that I'd like to get an independent review of it before merging.

This fixes #4134.

@simar7
Copy link

simar7 commented Jan 10, 2016

thanks @apparentlymart that's good to hear! Could you add my sign off to this patch as it builds on top of my work from the other diff I had submitted?

Signed-off-by: Simarpreet Singh simar@linux.com

@apparentlymart
Copy link
Contributor Author

@simar7 Terraform doesn't use the "Signed-off-by" convention but before I merge I'll update the commit message to note that I started from your work.

In most cases private keys are used to produce certs and cert requests,
but there are some less-common cases where the PEM-formatted keypair is
used alone. The public_key_pem attribute supports such cases.

This also includes a public_key_openssh attribute, which allows this
resource to be used to generate temporary OpenSSH credentials, so that
e.g. a Terraform configuration could generate its own keypair to use
with the aws_key_pair resource. This has the same caveats as all cases
where we generate private keys in Terraform, but could be useful for
temporary/throwaway environments where the state either doesn't live for
long or is stored securely.

This builds on work started by Simarpreet Singh in #4441 .
@phinze
Copy link
Contributor

phinze commented Jan 21, 2016

LGTM!

apparentlymart added a commit that referenced this pull request Jan 22, 2016
Export public keys from tls_private_key
@apparentlymart apparentlymart merged commit 7450abe into master Jan 22, 2016
@stack72 stack72 deleted the tls-public-key branch March 31, 2016 02:22
@ghost
Copy link

ghost commented Apr 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] [terraform-provider-tls] Add public key to resource output
3 participants