1. Packages
  2. Gitlab Provider
  3. API Docs
  4. ClusterAgentToken
GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi

gitlab.ClusterAgentToken

Explore with Pulumi AI

The gitlab.ClusterAgentToken resource allows to manage the lifecycle of a token for a GitLab Agent for Kubernetes.

Requires at least maintainer permissions on the project.

Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
import * as helm from "@pulumi/helm";

// Create token for an agent
const example = new gitlab.ClusterAgentToken("example", {
    project: "12345",
    agentId: 42,
    name: "some-token",
    description: "some token",
});
// The following example creates a GitLab Agent for Kubernetes in a given project,
// creates a token and install the `gitlab-agent` Helm Chart.
// (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
const _this = gitlab.getProject({
    pathWithNamespace: "my-org/example",
});
const thisClusterAgent = new gitlab.ClusterAgent("this", {
    project: _this.then(_this => _this.id),
    name: "my-agent",
});
const thisClusterAgentToken = new gitlab.ClusterAgentToken("this", {
    project: _this.then(_this => _this.id),
    agentId: thisClusterAgent.agentId,
    name: "my-agent-token",
    description: "Token for the my-agent used with `gitlab-agent` Helm Chart",
});
const gitlabAgent = new helm.index.Release("gitlab_agent", {
    name: "gitlab-agent",
    namespace: "gitlab-agent",
    createNamespace: true,
    repository: "https://charts.gitlab.io",
    chart: "gitlab-agent",
    version: "1.2.0",
    set: [{
        name: "config.token",
        value: thisClusterAgentToken.token,
    }],
});
Copy
import pulumi
import pulumi_gitlab as gitlab
import pulumi_helm as helm

# Create token for an agent
example = gitlab.ClusterAgentToken("example",
    project="12345",
    agent_id=42,
    name="some-token",
    description="some token")
# The following example creates a GitLab Agent for Kubernetes in a given project,
# creates a token and install the `gitlab-agent` Helm Chart.
# (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
this = gitlab.get_project(path_with_namespace="my-org/example")
this_cluster_agent = gitlab.ClusterAgent("this",
    project=this.id,
    name="my-agent")
this_cluster_agent_token = gitlab.ClusterAgentToken("this",
    project=this.id,
    agent_id=this_cluster_agent.agent_id,
    name="my-agent-token",
    description="Token for the my-agent used with `gitlab-agent` Helm Chart")
gitlab_agent = helm.index.Release("gitlab_agent",
    name=gitlab-agent,
    namespace=gitlab-agent,
    create_namespace=True,
    repository=https://charts.gitlab.io,
    chart=gitlab-agent,
    version=1.2.0,
    set=[{
        name: config.token,
        value: this_cluster_agent_token.token,
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
	"github.com/pulumi/pulumi-helm/sdk/go/helm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create token for an agent
		_, err := gitlab.NewClusterAgentToken(ctx, "example", &gitlab.ClusterAgentTokenArgs{
			Project:     pulumi.String("12345"),
			AgentId:     pulumi.Int(42),
			Name:        pulumi.String("some-token"),
			Description: pulumi.String("some token"),
		})
		if err != nil {
			return err
		}
		// The following example creates a GitLab Agent for Kubernetes in a given project,
		// creates a token and install the `gitlab-agent` Helm Chart.
		// (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
		this, err := gitlab.LookupProject(ctx, &gitlab.LookupProjectArgs{
			PathWithNamespace: pulumi.StringRef("my-org/example"),
		}, nil)
		if err != nil {
			return err
		}
		thisClusterAgent, err := gitlab.NewClusterAgent(ctx, "this", &gitlab.ClusterAgentArgs{
			Project: pulumi.String(this.Id),
			Name:    pulumi.String("my-agent"),
		})
		if err != nil {
			return err
		}
		thisClusterAgentToken, err := gitlab.NewClusterAgentToken(ctx, "this", &gitlab.ClusterAgentTokenArgs{
			Project:     pulumi.String(this.Id),
			AgentId:     thisClusterAgent.AgentId,
			Name:        pulumi.String("my-agent-token"),
			Description: pulumi.String("Token for the my-agent used with `gitlab-agent` Helm Chart"),
		})
		if err != nil {
			return err
		}
		_, err = helm.NewRelease(ctx, "gitlab_agent", &helm.ReleaseArgs{
			Name:            "gitlab-agent",
			Namespace:       "gitlab-agent",
			CreateNamespace: true,
			Repository:      "https://charts.gitlab.io",
			Chart:           "gitlab-agent",
			Version:         "1.2.0",
			Set: []map[string]interface{}{
				map[string]interface{}{
					"name":  "config.token",
					"value": thisClusterAgentToken.Token,
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
using Helm = Pulumi.Helm;

return await Deployment.RunAsync(() => 
{
    // Create token for an agent
    var example = new GitLab.ClusterAgentToken("example", new()
    {
        Project = "12345",
        AgentId = 42,
        Name = "some-token",
        Description = "some token",
    });

    // The following example creates a GitLab Agent for Kubernetes in a given project,
    // creates a token and install the `gitlab-agent` Helm Chart.
    // (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
    var @this = GitLab.GetProject.Invoke(new()
    {
        PathWithNamespace = "my-org/example",
    });

    var thisClusterAgent = new GitLab.ClusterAgent("this", new()
    {
        Project = @this.Apply(@this => @this.Apply(getProjectResult => getProjectResult.Id)),
        Name = "my-agent",
    });

    var thisClusterAgentToken = new GitLab.ClusterAgentToken("this", new()
    {
        Project = @this.Apply(@this => @this.Apply(getProjectResult => getProjectResult.Id)),
        AgentId = thisClusterAgent.AgentId,
        Name = "my-agent-token",
        Description = "Token for the my-agent used with `gitlab-agent` Helm Chart",
    });

    var gitlabAgent = new Helm.Index.Release("gitlab_agent", new()
    {
        Name = "gitlab-agent",
        Namespace = "gitlab-agent",
        CreateNamespace = true,
        Repository = "https://charts.gitlab.io",
        Chart = "gitlab-agent",
        Version = "1.2.0",
        Set = new[]
        {
            
            {
                { "name", "config.token" },
                { "value", thisClusterAgentToken.Token },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ClusterAgentToken;
import com.pulumi.gitlab.ClusterAgentTokenArgs;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetProjectArgs;
import com.pulumi.gitlab.ClusterAgent;
import com.pulumi.gitlab.ClusterAgentArgs;
import com.pulumi.helm.release;
import com.pulumi.helm.releaseArgs;
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) {
        // Create token for an agent
        var example = new ClusterAgentToken("example", ClusterAgentTokenArgs.builder()
            .project("12345")
            .agentId(42)
            .name("some-token")
            .description("some token")
            .build());

        // The following example creates a GitLab Agent for Kubernetes in a given project,
        // creates a token and install the `gitlab-agent` Helm Chart.
        // (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
        final var this = GitlabFunctions.getProject(GetProjectArgs.builder()
            .pathWithNamespace("my-org/example")
            .build());

        var thisClusterAgent = new ClusterAgent("thisClusterAgent", ClusterAgentArgs.builder()
            .project(this_.id())
            .name("my-agent")
            .build());

        var thisClusterAgentToken = new ClusterAgentToken("thisClusterAgentToken", ClusterAgentTokenArgs.builder()
            .project(this_.id())
            .agentId(thisClusterAgent.agentId())
            .name("my-agent-token")
            .description("Token for the my-agent used with `gitlab-agent` Helm Chart")
            .build());

        var gitlabAgent = new Release("gitlabAgent", ReleaseArgs.builder()
            .name("gitlab-agent")
            .namespace("gitlab-agent")
            .createNamespace(true)
            .repository("https://charts.gitlab.io")
            .chart("gitlab-agent")
            .version("1.2.0")
            .set(List.of(Map.ofEntries(
                Map.entry("name", "config.token"),
                Map.entry("value", thisClusterAgentToken.token())
            )))
            .build());

    }
}
Copy
resources:
  # Create token for an agent
  example:
    type: gitlab:ClusterAgentToken
    properties:
      project: '12345'
      agentId: 42
      name: some-token
      description: some token
  thisClusterAgent:
    type: gitlab:ClusterAgent
    name: this
    properties:
      project: ${this.id}
      name: my-agent
  thisClusterAgentToken:
    type: gitlab:ClusterAgentToken
    name: this
    properties:
      project: ${this.id}
      agentId: ${thisClusterAgent.agentId}
      name: my-agent-token
      description: Token for the my-agent used with `gitlab-agent` Helm Chart
  gitlabAgent:
    type: helm:release
    name: gitlab_agent
    properties:
      name: gitlab-agent
      namespace: gitlab-agent
      createNamespace: true
      repository: https://charts.gitlab.io
      chart: gitlab-agent
      version: 1.2.0
      set:
        - name: config.token
          value: ${thisClusterAgentToken.token}
variables:
  # The following example creates a GitLab Agent for Kubernetes in a given project,
  # // creates a token and install the `gitlab-agent` Helm Chart.
  # // (see https://gitlab.com/gitlab-org/charts/gitlab-agent)
  this:
    fn::invoke:
      function: gitlab:getProject
      arguments:
        pathWithNamespace: my-org/example
Copy

Create ClusterAgentToken Resource

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

Constructor syntax

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

@overload
def ClusterAgentToken(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      agent_id: Optional[int] = None,
                      project: Optional[str] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None)
func NewClusterAgentToken(ctx *Context, name string, args ClusterAgentTokenArgs, opts ...ResourceOption) (*ClusterAgentToken, error)
public ClusterAgentToken(string name, ClusterAgentTokenArgs args, CustomResourceOptions? opts = null)
public ClusterAgentToken(String name, ClusterAgentTokenArgs args)
public ClusterAgentToken(String name, ClusterAgentTokenArgs args, CustomResourceOptions options)
type: gitlab:ClusterAgentToken
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. ClusterAgentTokenArgs
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. ClusterAgentTokenArgs
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. ClusterAgentTokenArgs
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. ClusterAgentTokenArgs
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. ClusterAgentTokenArgs
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 clusterAgentTokenResource = new GitLab.ClusterAgentToken("clusterAgentTokenResource", new()
{
    AgentId = 0,
    Project = "string",
    Description = "string",
    Name = "string",
});
Copy
example, err := gitlab.NewClusterAgentToken(ctx, "clusterAgentTokenResource", &gitlab.ClusterAgentTokenArgs{
	AgentId:     pulumi.Int(0),
	Project:     pulumi.String("string"),
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var clusterAgentTokenResource = new ClusterAgentToken("clusterAgentTokenResource", ClusterAgentTokenArgs.builder()
    .agentId(0)
    .project("string")
    .description("string")
    .name("string")
    .build());
Copy
cluster_agent_token_resource = gitlab.ClusterAgentToken("clusterAgentTokenResource",
    agent_id=0,
    project="string",
    description="string",
    name="string")
Copy
const clusterAgentTokenResource = new gitlab.ClusterAgentToken("clusterAgentTokenResource", {
    agentId: 0,
    project: "string",
    description: "string",
    name: "string",
});
Copy
type: gitlab:ClusterAgentToken
properties:
    agentId: 0
    description: string
    name: string
    project: string
Copy

ClusterAgentToken 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 ClusterAgentToken resource accepts the following input properties:

AgentId
This property is required.
Changes to this property will trigger replacement.
int
The ID of the agent.
Project
This property is required.
Changes to this property will trigger replacement.
string
ID or full path of the project maintained by the authenticated user.
Description Changes to this property will trigger replacement. string
The Description for the agent.
Name Changes to this property will trigger replacement. string
The Name of the agent.
AgentId
This property is required.
Changes to this property will trigger replacement.
int
The ID of the agent.
Project
This property is required.
Changes to this property will trigger replacement.
string
ID or full path of the project maintained by the authenticated user.
Description Changes to this property will trigger replacement. string
The Description for the agent.
Name Changes to this property will trigger replacement. string
The Name of the agent.
agentId
This property is required.
Changes to this property will trigger replacement.
Integer
The ID of the agent.
project
This property is required.
Changes to this property will trigger replacement.
String
ID or full path of the project maintained by the authenticated user.
description Changes to this property will trigger replacement. String
The Description for the agent.
name Changes to this property will trigger replacement. String
The Name of the agent.
agentId
This property is required.
Changes to this property will trigger replacement.
number
The ID of the agent.
project
This property is required.
Changes to this property will trigger replacement.
string
ID or full path of the project maintained by the authenticated user.
description Changes to this property will trigger replacement. string
The Description for the agent.
name Changes to this property will trigger replacement. string
The Name of the agent.
agent_id
This property is required.
Changes to this property will trigger replacement.
int
The ID of the agent.
project
This property is required.
Changes to this property will trigger replacement.
str
ID or full path of the project maintained by the authenticated user.
description Changes to this property will trigger replacement. str
The Description for the agent.
name Changes to this property will trigger replacement. str
The Name of the agent.
agentId
This property is required.
Changes to this property will trigger replacement.
Number
The ID of the agent.
project
This property is required.
Changes to this property will trigger replacement.
String
ID or full path of the project maintained by the authenticated user.
description Changes to this property will trigger replacement. String
The Description for the agent.
name Changes to this property will trigger replacement. String
The Name of the agent.

Outputs

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

CreatedAt string
The ISO8601 datetime when the agent was created.
CreatedByUserId int
The ID of the user who created the agent.
Id string
The provider-assigned unique ID for this managed resource.
LastUsedAt string
The ISO8601 datetime when the token was last used.
Status string
The status of the token. Valid values are active, revoked.
Token string
The secret token for the agent. The token is not available in imported resources.
TokenId int
The ID of the token.
CreatedAt string
The ISO8601 datetime when the agent was created.
CreatedByUserId int
The ID of the user who created the agent.
Id string
The provider-assigned unique ID for this managed resource.
LastUsedAt string
The ISO8601 datetime when the token was last used.
Status string
The status of the token. Valid values are active, revoked.
Token string
The secret token for the agent. The token is not available in imported resources.
TokenId int
The ID of the token.
createdAt String
The ISO8601 datetime when the agent was created.
createdByUserId Integer
The ID of the user who created the agent.
id String
The provider-assigned unique ID for this managed resource.
lastUsedAt String
The ISO8601 datetime when the token was last used.
status String
The status of the token. Valid values are active, revoked.
token String
The secret token for the agent. The token is not available in imported resources.
tokenId Integer
The ID of the token.
createdAt string
The ISO8601 datetime when the agent was created.
createdByUserId number
The ID of the user who created the agent.
id string
The provider-assigned unique ID for this managed resource.
lastUsedAt string
The ISO8601 datetime when the token was last used.
status string
The status of the token. Valid values are active, revoked.
token string
The secret token for the agent. The token is not available in imported resources.
tokenId number
The ID of the token.
created_at str
The ISO8601 datetime when the agent was created.
created_by_user_id int
The ID of the user who created the agent.
id str
The provider-assigned unique ID for this managed resource.
last_used_at str
The ISO8601 datetime when the token was last used.
status str
The status of the token. Valid values are active, revoked.
token str
The secret token for the agent. The token is not available in imported resources.
token_id int
The ID of the token.
createdAt String
The ISO8601 datetime when the agent was created.
createdByUserId Number
The ID of the user who created the agent.
id String
The provider-assigned unique ID for this managed resource.
lastUsedAt String
The ISO8601 datetime when the token was last used.
status String
The status of the token. Valid values are active, revoked.
token String
The secret token for the agent. The token is not available in imported resources.
tokenId Number
The ID of the token.

Look up Existing ClusterAgentToken Resource

Get an existing ClusterAgentToken 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?: ClusterAgentTokenState, opts?: CustomResourceOptions): ClusterAgentToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        agent_id: Optional[int] = None,
        created_at: Optional[str] = None,
        created_by_user_id: Optional[int] = None,
        description: Optional[str] = None,
        last_used_at: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        status: Optional[str] = None,
        token: Optional[str] = None,
        token_id: Optional[int] = None) -> ClusterAgentToken
func GetClusterAgentToken(ctx *Context, name string, id IDInput, state *ClusterAgentTokenState, opts ...ResourceOption) (*ClusterAgentToken, error)
public static ClusterAgentToken Get(string name, Input<string> id, ClusterAgentTokenState? state, CustomResourceOptions? opts = null)
public static ClusterAgentToken get(String name, Output<String> id, ClusterAgentTokenState state, CustomResourceOptions options)
resources:  _:    type: gitlab:ClusterAgentToken    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:
AgentId Changes to this property will trigger replacement. int
The ID of the agent.
CreatedAt string
The ISO8601 datetime when the agent was created.
CreatedByUserId int
The ID of the user who created the agent.
Description Changes to this property will trigger replacement. string
The Description for the agent.
LastUsedAt string
The ISO8601 datetime when the token was last used.
Name Changes to this property will trigger replacement. string
The Name of the agent.
Project Changes to this property will trigger replacement. string
ID or full path of the project maintained by the authenticated user.
Status string
The status of the token. Valid values are active, revoked.
Token string
The secret token for the agent. The token is not available in imported resources.
TokenId int
The ID of the token.
AgentId Changes to this property will trigger replacement. int
The ID of the agent.
CreatedAt string
The ISO8601 datetime when the agent was created.
CreatedByUserId int
The ID of the user who created the agent.
Description Changes to this property will trigger replacement. string
The Description for the agent.
LastUsedAt string
The ISO8601 datetime when the token was last used.
Name Changes to this property will trigger replacement. string
The Name of the agent.
Project Changes to this property will trigger replacement. string
ID or full path of the project maintained by the authenticated user.
Status string
The status of the token. Valid values are active, revoked.
Token string
The secret token for the agent. The token is not available in imported resources.
TokenId int
The ID of the token.
agentId Changes to this property will trigger replacement. Integer
The ID of the agent.
createdAt String
The ISO8601 datetime when the agent was created.
createdByUserId Integer
The ID of the user who created the agent.
description Changes to this property will trigger replacement. String
The Description for the agent.
lastUsedAt String
The ISO8601 datetime when the token was last used.
name Changes to this property will trigger replacement. String
The Name of the agent.
project Changes to this property will trigger replacement. String
ID or full path of the project maintained by the authenticated user.
status String
The status of the token. Valid values are active, revoked.
token String
The secret token for the agent. The token is not available in imported resources.
tokenId Integer
The ID of the token.
agentId Changes to this property will trigger replacement. number
The ID of the agent.
createdAt string
The ISO8601 datetime when the agent was created.
createdByUserId number
The ID of the user who created the agent.
description Changes to this property will trigger replacement. string
The Description for the agent.
lastUsedAt string
The ISO8601 datetime when the token was last used.
name Changes to this property will trigger replacement. string
The Name of the agent.
project Changes to this property will trigger replacement. string
ID or full path of the project maintained by the authenticated user.
status string
The status of the token. Valid values are active, revoked.
token string
The secret token for the agent. The token is not available in imported resources.
tokenId number
The ID of the token.
agent_id Changes to this property will trigger replacement. int
The ID of the agent.
created_at str
The ISO8601 datetime when the agent was created.
created_by_user_id int
The ID of the user who created the agent.
description Changes to this property will trigger replacement. str
The Description for the agent.
last_used_at str
The ISO8601 datetime when the token was last used.
name Changes to this property will trigger replacement. str
The Name of the agent.
project Changes to this property will trigger replacement. str
ID or full path of the project maintained by the authenticated user.
status str
The status of the token. Valid values are active, revoked.
token str
The secret token for the agent. The token is not available in imported resources.
token_id int
The ID of the token.
agentId Changes to this property will trigger replacement. Number
The ID of the agent.
createdAt String
The ISO8601 datetime when the agent was created.
createdByUserId Number
The ID of the user who created the agent.
description Changes to this property will trigger replacement. String
The Description for the agent.
lastUsedAt String
The ISO8601 datetime when the token was last used.
name Changes to this property will trigger replacement. String
The Name of the agent.
project Changes to this property will trigger replacement. String
ID or full path of the project maintained by the authenticated user.
status String
The status of the token. Valid values are active, revoked.
token String
The secret token for the agent. The token is not available in imported resources.
tokenId Number
The ID of the token.

Import

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

terraform

import {

to = gitlab_cluster_agent_token.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

A token for a GitLab Agent for Kubernetes can be imported with the following command and the id pattern <project>:<agent-id>:<token-id>:

$ pulumi import gitlab:index/clusterAgentToken:ClusterAgentToken example '12345:42:1'
Copy

ATTENTION: the token resource attribute is not available for imported resources as this information cannot be read from the GitLab API.

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.