The SSH public key information associated with a Google account.
To get more information about SSHPublicKey, see:
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")
}
The following arguments are supported:
key
-
(Required)
Public key text in SSH format, defined by RFC4253 section 6.6.
user
-
(Required)
The user email.
expiration_time_usec
-
(Optional)
An expiration time in microseconds since epoch.
project
-
(Optional)
The project ID of the Google Cloud Platform project.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format users/{{user}}/sshPublicKeys/{{fingerprint}}
fingerprint
-
The SHA-256 fingerprint of the SSH public key.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.SSHPublicKey can be imported using any of these accepted formats:
users/{{user}}/sshPublicKeys/{{fingerprint}}
{{user}}/{{fingerprint}}
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}}