Runner Args
data class RunnerArgs(val accessLevel: Output<String>? = null, val description: Output<String>? = null, val locked: Output<Boolean>? = null, val maximumTimeout: Output<Int>? = null, val paused: Output<Boolean>? = null, val registrationToken: Output<String>? = null, val runUntagged: Output<Boolean>? = null, val tagLists: Output<List<String>>? = null) : ConvertibleToJava<RunnerArgs>
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());
}
}
Content copied to clipboard
Import
A GitLab Runner can be imported using the runner's ID, eg
$ pulumi import gitlab:index/runner:Runner this 1
Content copied to clipboard
Constructors
Link copied to clipboard
fun RunnerArgs(accessLevel: Output<String>? = null, description: Output<String>? = null, locked: Output<Boolean>? = null, maximumTimeout: Output<Int>? = null, paused: Output<Boolean>? = null, registrationToken: Output<String>? = null, runUntagged: Output<Boolean>? = null, tagLists: Output<List<String>>? = null)