Deploy Key Enable Args
data class DeployKeyEnableArgs(val canPush: Output<Boolean>? = null, val key: Output<String>? = null, val keyId: Output<String>? = null, val project: Output<String>? = null, val title: Output<String>? = null) : ConvertibleToJava<DeployKeyEnableArgs>
The gitlab.DeployKeyEnable
resource allows to enable an already existing deploy key (see gitlab.DeployKey resource
) for a specific project. Upstream API: GitLab REST API docs
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.DeployKey;
import com.pulumi.gitlab.DeployKeyArgs;
import com.pulumi.gitlab.DeployKeyEnable;
import com.pulumi.gitlab.DeployKeyEnableArgs;
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 parentProject = new Project("parentProject");
var fooProject = new Project("fooProject");
var parentDeployKey = new DeployKey("parentDeployKey", DeployKeyArgs.builder()
.project(parentProject.id())
.title("Example deploy key")
.key("ssh-rsa AAAA...")
.build());
var fooDeployKeyEnable = new DeployKeyEnable("fooDeployKeyEnable", DeployKeyEnableArgs.builder()
.project(fooProject.id())
.keyId(parentDeployKey.id())
.build());
}
}
Content copied to clipboard
Import
GitLab enabled 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/deployKeyEnable:DeployKeyEnable example 12345:67890
Content copied to clipboard
$ pulumi import gitlab:index/deployKeyEnable:DeployKeyEnable example richardc/example:67890
Content copied to clipboard