DeployKey

class DeployKey : KotlinCustomResource

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

To enable an already existing deploy key for another project use the gitlab_project_deploy_key resource. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.DeployKey("example", {
project: "example/deploying",
title: "Example deploy key",
key: "ssh-ed25519 AAAA...",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.DeployKey("example",
project="example/deploying",
title="Example deploy key",
key="ssh-ed25519 AAAA...")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.DeployKey("example", new()
{
Project = "example/deploying",
Title = "Example deploy key",
Key = "ssh-ed25519 AAAA...",
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v7/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewDeployKey(ctx, "example", &gitlab.DeployKeyArgs{
Project: pulumi.String("example/deploying"),
Title: pulumi.String("Example deploy key"),
Key: pulumi.String("ssh-ed25519 AAAA..."),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.DeployKey;
import com.pulumi.gitlab.DeployKeyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new DeployKey("example", DeployKeyArgs.builder()
.project("example/deploying")
.title("Example deploy key")
.key("ssh-ed25519 AAAA...")
.build());
}
}
resources:
example:
type: gitlab:DeployKey
properties:
project: example/deploying
title: Example deploy key
key: ssh-ed25519 AAAA...

Import

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 takes for its :id value, so for example:

$ pulumi import gitlab:index/deployKey:DeployKey test 1:3
$ pulumi import gitlab:index/deployKey:DeployKey test richardc/example:3

Properties

Link copied to clipboard
val canPush: Output<Boolean>?

Allow this deploy key to be used to push changes to the project. Defaults to false.

Link copied to clipboard
val deployKeyId: Output<Int>

The id of the project deploy key.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val key: Output<String>

The public ssh key body.

Link copied to clipboard
val project: Output<String>

The name or id of the project to add the deploy key to.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val title: Output<String>

A title to describe the deploy key with.

Link copied to clipboard
val urn: Output<String>