gitlab_deploy_key (Resource)

The gitlab_deploy_key resource allows to manage the lifecycle of a deploy key.

Upstream API: GitLab REST API docs

Example Usage

resource "gitlab_deploy_key" "example" {
  project = "example/deploying"
  title   = "Example deploy key"
  key     = "ssh-ed25519 AAAA..."
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

# GitLab deploy keys can be imported using an id made up of `{project_id}:{deploy_key_id}`, e.g.
# `project_id` can be whatever the [get single project api][get_single_project] takes for
# its `:id` value, so for example:
terraform import gitlab_deploy_key.test 1:3
terraform import gitlab_deploy_key.test richardc/example:3