Runner

class Runner : KotlinCustomResource

The gitlab.Runner resource allows to manage the lifecycle of a runner. A runner can either be registered at an instance level or group level. The runner will be registered at a group level if the token used is from a group, or at an instance level if the token used is for the instance. ~ Using this resource will register a runner using the deprecated registration_token flow. To use the new authentication_token flow instead, use the gitlab.UserRunner resource! 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.Group;
import com.pulumi.gitlab.GroupArgs;
import com.pulumi.gitlab.Runner;
import com.pulumi.gitlab.RunnerArgs;
import com.pulumi.local.File;
import com.pulumi.local.FileArgs;
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 myGroup = new Group("myGroup", GroupArgs.builder()
.description("group that holds the runners")
.build());
var basicRunner = new Runner("basicRunner", RunnerArgs.builder()
.registrationToken(myGroup.runnersToken())
.build());
var taggedOnly = new Runner("taggedOnly", RunnerArgs.builder()
.registrationToken(myGroup.runnersToken())
.description("I only run tagged jobs")
.runUntagged("false")
.tagLists(
"tag_one",
"tag_two")
.build());
var protected_ = new Runner("protected", RunnerArgs.builder()
.registrationToken(myGroup.runnersToken())
.description("I only run protected jobs")
.accessLevel("ref_protected")
.build());
var myCustomGroup = new Group("myCustomGroup", GroupArgs.builder()
.description("group that holds the custom runners")
.build());
var myRunner = new Runner("myRunner", RunnerArgs.builder()
.registrationToken(myCustomGroup.runnersToken())
.build());
var config = new File("config", FileArgs.builder()
.filename(String.format("%s/config.toml", path.module()))
.content(myRunner.authenticationToken().applyValue(authenticationToken -> """
concurrent = 1
[[runners]]
name = "Hello Terraform"
url = "https://example.gitlab.com/"
token = "%s"
executor = "shell"
", authenticationToken)))
.build());
}
}

Import

A GitLab Runner can be imported using the runner's ID, eg

$ pulumi import gitlab:index/runner:Runner this 1

Properties

Link copied to clipboard
val accessLevel: Output<String>

The access_level of the runner. Valid values are: not_protected, ref_protected.

Link copied to clipboard

The authentication token used for building a config.toml file. This value is not present when imported.

Link copied to clipboard
val description: Output<String>?

The runner's description.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val locked: Output<Boolean>

Whether the runner should be locked for current project.

Link copied to clipboard
val maximumTimeout: Output<Int>?

Maximum timeout set when this runner handles the job.

Link copied to clipboard
val paused: Output<Boolean>

Whether the runner should ignore new jobs.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The registration token used to register the runner.

Link copied to clipboard
val runUntagged: Output<Boolean>

Whether the runner should handle untagged jobs.

Link copied to clipboard
val status: Output<String>

The status of runners to show, one of: online and offline. active and paused are also possible values which were deprecated in GitLab 14.8 and will be removed in GitLab 16.0.

Link copied to clipboard
val tagLists: Output<List<String>>?

List of runner’s tags.

Link copied to clipboard
val urn: Output<String>