google_os_login_ssh_public_key

The SSH public key information associated with a Google account.

To get more information about SSHPublicKey, see:

Open in Cloud Shell

Example Usage - Os Login Ssh Key Basic

data "google_client_openid_userinfo" "me" {
}

resource "google_os_login_ssh_public_key" "cache" {
  user =  data.google_client_openid_userinfo.me.email
  key = file("path/to/id_rsa.pub")
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

SSHPublicKey can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import SSHPublicKey using one of the formats above. For example:

import {
  id = "users/{{user}}/sshPublicKeys/{{fingerprint}}"
  to = google_os_login_ssh_public_key.default
}

When using the terraform import command, SSHPublicKey can be imported using one of the formats above. For example:

$ terraform import google_os_login_ssh_public_key.default users/{{user}}/sshPublicKeys/{{fingerprint}}
$ terraform import google_os_login_ssh_public_key.default {{user}}/{{fingerprint}}