1. Packages
  2. Gitlab Provider
  3. API Docs
  4. Runner
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.Runner

Explore with Pulumi AI

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

Create Runner Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Runner(name: string, args: RunnerArgs, opts?: CustomResourceOptions);
@overload
def Runner(resource_name: str,
           args: RunnerArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Runner(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           registration_token: Optional[str] = None,
           access_level: Optional[str] = None,
           description: Optional[str] = None,
           locked: Optional[bool] = None,
           maintenance_note: Optional[str] = None,
           maximum_timeout: Optional[int] = None,
           paused: Optional[bool] = None,
           run_untagged: Optional[bool] = None,
           tag_lists: Optional[Sequence[str]] = None)
func NewRunner(ctx *Context, name string, args RunnerArgs, opts ...ResourceOption) (*Runner, error)
public Runner(string name, RunnerArgs args, CustomResourceOptions? opts = null)
public Runner(String name, RunnerArgs args)
public Runner(String name, RunnerArgs args, CustomResourceOptions options)
type: gitlab:Runner
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RunnerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RunnerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RunnerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RunnerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RunnerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var runnerResource = new GitLab.Runner("runnerResource", new()
{
    RegistrationToken = "string",
    AccessLevel = "string",
    Description = "string",
    Locked = false,
    MaintenanceNote = "string",
    MaximumTimeout = 0,
    Paused = false,
    RunUntagged = false,
    TagLists = new[]
    {
        "string",
    },
});
Copy
example, err := gitlab.NewRunner(ctx, "runnerResource", &gitlab.RunnerArgs{
	RegistrationToken: pulumi.String("string"),
	AccessLevel:       pulumi.String("string"),
	Description:       pulumi.String("string"),
	Locked:            pulumi.Bool(false),
	MaintenanceNote:   pulumi.String("string"),
	MaximumTimeout:    pulumi.Int(0),
	Paused:            pulumi.Bool(false),
	RunUntagged:       pulumi.Bool(false),
	TagLists: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var runnerResource = new Runner("runnerResource", RunnerArgs.builder()
    .registrationToken("string")
    .accessLevel("string")
    .description("string")
    .locked(false)
    .maintenanceNote("string")
    .maximumTimeout(0)
    .paused(false)
    .runUntagged(false)
    .tagLists("string")
    .build());
Copy
runner_resource = gitlab.Runner("runnerResource",
    registration_token="string",
    access_level="string",
    description="string",
    locked=False,
    maintenance_note="string",
    maximum_timeout=0,
    paused=False,
    run_untagged=False,
    tag_lists=["string"])
Copy
const runnerResource = new gitlab.Runner("runnerResource", {
    registrationToken: "string",
    accessLevel: "string",
    description: "string",
    locked: false,
    maintenanceNote: "string",
    maximumTimeout: 0,
    paused: false,
    runUntagged: false,
    tagLists: ["string"],
});
Copy
type: gitlab:Runner
properties:
    accessLevel: string
    description: string
    locked: false
    maintenanceNote: string
    maximumTimeout: 0
    paused: false
    registrationToken: string
    runUntagged: false
    tagLists:
        - string
Copy

Runner Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Runner resource accepts the following input properties:

RegistrationToken
This property is required.
Changes to this property will trigger replacement.
string
The registration token used to register the runner.
AccessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
Description string
The runner's description.
Locked bool
Whether the runner should be locked for current project.
MaintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
MaximumTimeout int
Maximum timeout set when this runner handles the job.
Paused bool
Whether the runner should ignore new jobs.
RunUntagged bool
Whether the runner should handle untagged jobs.
TagLists List<string>
List of runner’s tags.
RegistrationToken
This property is required.
Changes to this property will trigger replacement.
string
The registration token used to register the runner.
AccessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
Description string
The runner's description.
Locked bool
Whether the runner should be locked for current project.
MaintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
MaximumTimeout int
Maximum timeout set when this runner handles the job.
Paused bool
Whether the runner should ignore new jobs.
RunUntagged bool
Whether the runner should handle untagged jobs.
TagLists []string
List of runner’s tags.
registrationToken
This property is required.
Changes to this property will trigger replacement.
String
The registration token used to register the runner.
accessLevel String
The access_level of the runner. Valid values are: not_protected, ref_protected.
description String
The runner's description.
locked Boolean
Whether the runner should be locked for current project.
maintenanceNote String
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout Integer
Maximum timeout set when this runner handles the job.
paused Boolean
Whether the runner should ignore new jobs.
runUntagged Boolean
Whether the runner should handle untagged jobs.
tagLists List<String>
List of runner’s tags.
registrationToken
This property is required.
Changes to this property will trigger replacement.
string
The registration token used to register the runner.
accessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
description string
The runner's description.
locked boolean
Whether the runner should be locked for current project.
maintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout number
Maximum timeout set when this runner handles the job.
paused boolean
Whether the runner should ignore new jobs.
runUntagged boolean
Whether the runner should handle untagged jobs.
tagLists string[]
List of runner’s tags.
registration_token
This property is required.
Changes to this property will trigger replacement.
str
The registration token used to register the runner.
access_level str
The access_level of the runner. Valid values are: not_protected, ref_protected.
description str
The runner's description.
locked bool
Whether the runner should be locked for current project.
maintenance_note str
Free-form maintenance notes for the runner (1024 characters).
maximum_timeout int
Maximum timeout set when this runner handles the job.
paused bool
Whether the runner should ignore new jobs.
run_untagged bool
Whether the runner should handle untagged jobs.
tag_lists Sequence[str]
List of runner’s tags.
registrationToken
This property is required.
Changes to this property will trigger replacement.
String
The registration token used to register the runner.
accessLevel String
The access_level of the runner. Valid values are: not_protected, ref_protected.
description String
The runner's description.
locked Boolean
Whether the runner should be locked for current project.
maintenanceNote String
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout Number
Maximum timeout set when this runner handles the job.
paused Boolean
Whether the runner should ignore new jobs.
runUntagged Boolean
Whether the runner should handle untagged jobs.
tagLists List<String>
List of runner’s tags.

Outputs

All input properties are implicitly available as output properties. Additionally, the Runner resource produces the following output properties:

AuthenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
Id string
The provider-assigned unique ID for this managed resource.
Status 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.
AuthenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
Id string
The provider-assigned unique ID for this managed resource.
Status 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.
authenticationToken String
The authentication token used for building a config.toml file. This value is not present when imported.
id String
The provider-assigned unique ID for this managed resource.
status 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.
authenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
id string
The provider-assigned unique ID for this managed resource.
status 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.
authentication_token str
The authentication token used for building a config.toml file. This value is not present when imported.
id str
The provider-assigned unique ID for this managed resource.
status str
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.
authenticationToken String
The authentication token used for building a config.toml file. This value is not present when imported.
id String
The provider-assigned unique ID for this managed resource.
status 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.

Look up Existing Runner Resource

Get an existing Runner resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RunnerState, opts?: CustomResourceOptions): Runner
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_level: Optional[str] = None,
        authentication_token: Optional[str] = None,
        description: Optional[str] = None,
        locked: Optional[bool] = None,
        maintenance_note: Optional[str] = None,
        maximum_timeout: Optional[int] = None,
        paused: Optional[bool] = None,
        registration_token: Optional[str] = None,
        run_untagged: Optional[bool] = None,
        status: Optional[str] = None,
        tag_lists: Optional[Sequence[str]] = None) -> Runner
func GetRunner(ctx *Context, name string, id IDInput, state *RunnerState, opts ...ResourceOption) (*Runner, error)
public static Runner Get(string name, Input<string> id, RunnerState? state, CustomResourceOptions? opts = null)
public static Runner get(String name, Output<String> id, RunnerState state, CustomResourceOptions options)
resources:  _:    type: gitlab:Runner    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
AuthenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
Description string
The runner's description.
Locked bool
Whether the runner should be locked for current project.
MaintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
MaximumTimeout int
Maximum timeout set when this runner handles the job.
Paused bool
Whether the runner should ignore new jobs.
RegistrationToken Changes to this property will trigger replacement. string
The registration token used to register the runner.
RunUntagged bool
Whether the runner should handle untagged jobs.
Status 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.
TagLists List<string>
List of runner’s tags.
AccessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
AuthenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
Description string
The runner's description.
Locked bool
Whether the runner should be locked for current project.
MaintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
MaximumTimeout int
Maximum timeout set when this runner handles the job.
Paused bool
Whether the runner should ignore new jobs.
RegistrationToken Changes to this property will trigger replacement. string
The registration token used to register the runner.
RunUntagged bool
Whether the runner should handle untagged jobs.
Status 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.
TagLists []string
List of runner’s tags.
accessLevel String
The access_level of the runner. Valid values are: not_protected, ref_protected.
authenticationToken String
The authentication token used for building a config.toml file. This value is not present when imported.
description String
The runner's description.
locked Boolean
Whether the runner should be locked for current project.
maintenanceNote String
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout Integer
Maximum timeout set when this runner handles the job.
paused Boolean
Whether the runner should ignore new jobs.
registrationToken Changes to this property will trigger replacement. String
The registration token used to register the runner.
runUntagged Boolean
Whether the runner should handle untagged jobs.
status 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.
tagLists List<String>
List of runner’s tags.
accessLevel string
The access_level of the runner. Valid values are: not_protected, ref_protected.
authenticationToken string
The authentication token used for building a config.toml file. This value is not present when imported.
description string
The runner's description.
locked boolean
Whether the runner should be locked for current project.
maintenanceNote string
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout number
Maximum timeout set when this runner handles the job.
paused boolean
Whether the runner should ignore new jobs.
registrationToken Changes to this property will trigger replacement. string
The registration token used to register the runner.
runUntagged boolean
Whether the runner should handle untagged jobs.
status 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.
tagLists string[]
List of runner’s tags.
access_level str
The access_level of the runner. Valid values are: not_protected, ref_protected.
authentication_token str
The authentication token used for building a config.toml file. This value is not present when imported.
description str
The runner's description.
locked bool
Whether the runner should be locked for current project.
maintenance_note str
Free-form maintenance notes for the runner (1024 characters).
maximum_timeout int
Maximum timeout set when this runner handles the job.
paused bool
Whether the runner should ignore new jobs.
registration_token Changes to this property will trigger replacement. str
The registration token used to register the runner.
run_untagged bool
Whether the runner should handle untagged jobs.
status str
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.
tag_lists Sequence[str]
List of runner’s tags.
accessLevel String
The access_level of the runner. Valid values are: not_protected, ref_protected.
authenticationToken String
The authentication token used for building a config.toml file. This value is not present when imported.
description String
The runner's description.
locked Boolean
Whether the runner should be locked for current project.
maintenanceNote String
Free-form maintenance notes for the runner (1024 characters).
maximumTimeout Number
Maximum timeout set when this runner handles the job.
paused Boolean
Whether the runner should ignore new jobs.
registrationToken Changes to this property will trigger replacement. String
The registration token used to register the runner.
runUntagged Boolean
Whether the runner should handle untagged jobs.
status 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.
tagLists List<String>
List of runner’s tags.

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_runner. For example:

terraform

import {

to = gitlab_runner.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

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

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

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.