terraform-provider-tls icon indicating copy to clipboard operation
terraform-provider-tls copied to clipboard

Allow tls_public_key to retrieve public keys from SSH servers

Open troyready opened this issue 4 years ago • 1 comments

This allows SSH authorized_key files to be populated based on an existing remote server's public key.

This still needs some DRY editing and test updates, but opening as a PR early to get my proof of concept code in place for some feedback on attribute naming, etc, first.

This allows the data source to be used like:

data "tls_public_key" "codecommit" {
  ssh_server_uri = "git-codecommit.${var.region}.amazonaws.com"
}

...

  data = {
    known_hosts = "git-codecommit.${var.region}.amazonaws.com ${data.tls_public_key.codecommit.public_key_openssh}"
  }

...

troyready avatar Jan 08 '21 01:01 troyready

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Mar 12 '22 17:03 hashicorp-cla