ClusterAgentArgs

data class ClusterAgentArgs(val name: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<ClusterAgentArgs>

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

Note that this resource only registers the agent, but doesn't configure it. The configuration needs to be manually added as described in the docs. However, a gitlab.RepositoryFile resource may be used to achieve that. Requires at least maintainer permissions on the project. Requires at least GitLab 14.10 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.ClusterAgent;
import com.pulumi.gitlab.ClusterAgentArgs;
import com.pulumi.gitlab.RepositoryFile;
import com.pulumi.gitlab.RepositoryFileArgs;
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 example = new ClusterAgent("example", ClusterAgentArgs.builder()
.project("12345")
.build());
var exampleAgentConfig = new RepositoryFile("exampleAgentConfig", RepositoryFileArgs.builder()
.project(example.project())
.branch("main")
.filePath(example.name().applyValue(name -> String.format(".gitlab/agents/%s", name)))
.content("""
gitops:
...
""")
.authorEmail("terraform@example.com")
.authorName("Terraform")
.commitMessage(example.name().applyValue(name -> String.format("feature: add agent config for %s", name)))
.build());
}
}

Import

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

$ pulumi import gitlab:index/clusterAgent:ClusterAgent example '12345:42'

Constructors

Link copied to clipboard
constructor(name: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val name: Output<String>? = null

The Name of the agent.

Link copied to clipboard
val project: Output<String>? = null

ID or full path of the project maintained by the authenticated user.

Functions

Link copied to clipboard
open override fun toJava(): ClusterAgentArgs