0
0
llucycodes42
The following code sets up a packet_ssh_key resource to store the public key for a given resource. The name of the resource is set to my-description-myResourceName and the description is set to my-description-myResourceName . The public_key attribute points to the path to the public key file, which is stored in the home directory of the terraform user.
Shortcut: tf_packet_ssh_key
resource "packet_ssh_key" "${myResourceName}" {
name = "my-${myResourceName}"
description = "my-description-${myResourceName}"
public_key = "\${file("/home/terraform/.ssh/id_rsa.pub")}"
}