terraform-provider-tls
terraform-provider-tls copied to clipboard
Allow tls_public_key to retrieve public keys from SSH servers
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}"
}
...