The gitlab_deploy_key
resource allows to manage the lifecycle of a deploy key.
Upstream API: GitLab REST API docs
resource "gitlab_deploy_key" "example" {
project = "example/deploying"
title = "Example deploy key"
key = "ssh-ed25519 AAAA..."
}
key
(String) The public ssh key body.project
(String) The name or id of the project to add the deploy key to.title
(String) A title to describe the deploy key with.can_push
(Boolean) Allow this deploy key to be used to push changes to the project. Defaults to false
.deploy_key_id
(Number) The id of the project deploy key.id
(String) The ID of this resource.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