gitlab_user_sshkey (Resource)

The gitlab_user_sshkey resource allows to manage the lifecycle of an SSH key assigned to a user.

Upstream API: GitLab API docs

Example Usage

data "gitlab_user" "example" {
  username = "example-user"
}

resource "gitlab_user_sshkey" "example" {
  user_id    = data.gitlab_user.example.id
  title      = "example-key"
  key        = "ssh-ed25519 AAAA..."
  expires_at = "2016-01-21T00:00:00.000Z"
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

# You can import a user ssh key using an id made up of `{user-id}:{key}`, e.g.
terraform import gitlab_user_sshkey.example 42:1