Github authorized_keys into terraform list

I needed to create a list of my authorized keys from the Github source in terraform. The following will provide a list that you can use. Handy for cloud init.

data "http" "github-keys" {
  url = "https://github.com/ledakis.keys"
}

output "keys" {
    value = compact(split("\n",data.http.github-keys.body))
}

Gist here.

© Copyright 2019-2020 by Theocharis Ledakis.