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

gitlab.getClusterAgent

Explore with Pulumi AI

GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

The gitlab.ClusterAgent data source allows to retrieve details about a GitLab Agent for Kubernetes.

Upstream API: GitLab REST API docs

Example Usage

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

const example = gitlab.getClusterAgent({
    project: "12345",
    agentId: 1,
});
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_cluster_agent(project="12345",
    agent_id=1)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.LookupClusterAgent(ctx, &gitlab.LookupClusterAgentArgs{
			Project: "12345",
			AgentId: 1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var example = GitLab.GetClusterAgent.Invoke(new()
    {
        Project = "12345",
        AgentId = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetClusterAgentArgs;
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) {
        final var example = GitlabFunctions.getClusterAgent(GetClusterAgentArgs.builder()
            .project("12345")
            .agentId(1)
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gitlab:getClusterAgent
      arguments:
        project: '12345'
        agentId: 1
Copy

Using getClusterAgent

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getClusterAgent(args: GetClusterAgentArgs, opts?: InvokeOptions): Promise<GetClusterAgentResult>
function getClusterAgentOutput(args: GetClusterAgentOutputArgs, opts?: InvokeOptions): Output<GetClusterAgentResult>
Copy
def get_cluster_agent(agent_id: Optional[int] = None,
                      project: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetClusterAgentResult
def get_cluster_agent_output(agent_id: Optional[pulumi.Input[int]] = None,
                      project: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetClusterAgentResult]
Copy
func LookupClusterAgent(ctx *Context, args *LookupClusterAgentArgs, opts ...InvokeOption) (*LookupClusterAgentResult, error)
func LookupClusterAgentOutput(ctx *Context, args *LookupClusterAgentOutputArgs, opts ...InvokeOption) LookupClusterAgentResultOutput
Copy

> Note: This function is named LookupClusterAgent in the Go SDK.

public static class GetClusterAgent 
{
    public static Task<GetClusterAgentResult> InvokeAsync(GetClusterAgentArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterAgentResult> Invoke(GetClusterAgentInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetClusterAgentResult> getClusterAgent(GetClusterAgentArgs args, InvokeOptions options)
public static Output<GetClusterAgentResult> getClusterAgent(GetClusterAgentArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getClusterAgent:getClusterAgent
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AgentId This property is required. int
The ID of the agent.
Project This property is required. string
ID or full path of the project maintained by the authenticated user.
AgentId This property is required. int
The ID of the agent.
Project This property is required. string
ID or full path of the project maintained by the authenticated user.
agentId This property is required. Integer
The ID of the agent.
project This property is required. String
ID or full path of the project maintained by the authenticated user.
agentId This property is required. number
The ID of the agent.
project This property is required. string
ID or full path of the project maintained by the authenticated user.
agent_id This property is required. int
The ID of the agent.
project This property is required. str
ID or full path of the project maintained by the authenticated user.
agentId This property is required. Number
The ID of the agent.
project This property is required. String
ID or full path of the project maintained by the authenticated user.

getClusterAgent Result

The following output properties are available:

AgentId 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.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The Name of the agent.
Project string
ID or full path of the project maintained by the authenticated user.
AgentId 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.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The Name of the agent.
Project string
ID or full path of the project maintained by the authenticated user.
agentId 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.
id String
The provider-assigned unique ID for this managed resource.
name String
The Name of the agent.
project String
ID or full path of the project maintained by the authenticated user.
agentId 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.
id string
The provider-assigned unique ID for this managed resource.
name string
The Name of the agent.
project string
ID or full path of the project maintained by the authenticated user.
agent_id 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.
id str
The provider-assigned unique ID for this managed resource.
name str
The Name of the agent.
project str
ID or full path of the project maintained by the authenticated user.
agentId 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.
id String
The provider-assigned unique ID for this managed resource.
name String
The Name of the agent.
project String
ID or full path of the project maintained by the authenticated user.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi