Project Cluster
The gitlab.ProjectCluster
resource allows to manage the lifecycle of a project cluster.
This is deprecated GitLab feature since 14.5 Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const foo = new gitlab.Project("foo", {name: "foo-project"});
const bar = new gitlab.ProjectCluster("bar", {
project: foo.id,
name: "bar-cluster",
domain: "example.com",
enabled: true,
kubernetesApiUrl: "https://124.124.124",
kubernetesToken: "some-token",
kubernetesCaCert: "some-cert",
kubernetesNamespace: "namespace",
kubernetesAuthorizationType: "rbac",
environmentScope: "*",
managementProjectId: "123456",
});
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.Project("foo", name="foo-project")
bar = gitlab.ProjectCluster("bar",
project=foo.id,
name="bar-cluster",
domain="example.com",
enabled=True,
kubernetes_api_url="https://124.124.124",
kubernetes_token="some-token",
kubernetes_ca_cert="some-cert",
kubernetes_namespace="namespace",
kubernetes_authorization_type="rbac",
environment_scope="*",
management_project_id="123456")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var foo = new GitLab.Project("foo", new()
{
Name = "foo-project",
});
var bar = new GitLab.ProjectCluster("bar", new()
{
Project = foo.Id,
Name = "bar-cluster",
Domain = "example.com",
Enabled = true,
KubernetesApiUrl = "https://124.124.124",
KubernetesToken = "some-token",
KubernetesCaCert = "some-cert",
KubernetesNamespace = "namespace",
KubernetesAuthorizationType = "rbac",
EnvironmentScope = "*",
ManagementProjectId = "123456",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v7/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := gitlab.NewProject(ctx, "foo", &gitlab.ProjectArgs{
Name: pulumi.String("foo-project"),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectCluster(ctx, "bar", &gitlab.ProjectClusterArgs{
Project: foo.ID(),
Name: pulumi.String("bar-cluster"),
Domain: pulumi.String("example.com"),
Enabled: pulumi.Bool(true),
KubernetesApiUrl: pulumi.String("https://124.124.124"),
KubernetesToken: pulumi.String("some-token"),
KubernetesCaCert: pulumi.String("some-cert"),
KubernetesNamespace: pulumi.String("namespace"),
KubernetesAuthorizationType: pulumi.String("rbac"),
EnvironmentScope: pulumi.String("*"),
ManagementProjectId: pulumi.String("123456"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ProjectCluster;
import com.pulumi.gitlab.ProjectClusterArgs;
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 foo = new Project("foo", ProjectArgs.builder()
.name("foo-project")
.build());
var bar = new ProjectCluster("bar", ProjectClusterArgs.builder()
.project(foo.id())
.name("bar-cluster")
.domain("example.com")
.enabled(true)
.kubernetesApiUrl("https://124.124.124")
.kubernetesToken("some-token")
.kubernetesCaCert("some-cert")
.kubernetesNamespace("namespace")
.kubernetesAuthorizationType("rbac")
.environmentScope("*")
.managementProjectId("123456")
.build());
}
}
Content copied to clipboard
resources:
foo:
type: gitlab:Project
properties:
name: foo-project
bar:
type: gitlab:ProjectCluster
properties:
project: ${foo.id}
name: bar-cluster
domain: example.com
enabled: true
kubernetesApiUrl: https://124.124.124
kubernetesToken: some-token
kubernetesCaCert: some-cert
kubernetesNamespace: namespace
kubernetesAuthorizationType: rbac
environmentScope: '*'
managementProjectId: '123456'
Content copied to clipboard
Import
GitLab project clusters can be imported using an id made up of projectid:clusterid
, e.g.
$ pulumi import gitlab:index/projectCluster:ProjectCluster bar 123:321
Content copied to clipboard
Properties
Link copied to clipboard
Cluster type.
Link copied to clipboard
The associated environment to the cluster. Defaults to *
.
Link copied to clipboard
The URL to access the Kubernetes API.
Link copied to clipboard
The cluster authorization type. Valid values are rbac
, abac
, unknown_authorization
. Defaults to rbac
.
Link copied to clipboard
TLS certificate (needed if API is using a self-signed TLS certificate).
Link copied to clipboard
The unique namespace related to the project.
Link copied to clipboard
The token to authenticate against Kubernetes.
Link copied to clipboard
The ID of the management project for the cluster.
Link copied to clipboard
Platform type.
Link copied to clipboard
Provider type.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard