Skip to content

Commit 6a9c6f9

Browse files
add docs for gitlab_project_cluster
1 parent 03b2b04 commit 6a9c6f9

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_project_cluster"
4+
sidebar_current: "docs-gitlab-resource-project_cluster"
5+
description: |-
6+
Creates and manages project clusters for GitLab projects
7+
---
8+
9+
# gitlab\_project\_cluster
10+
11+
This resource allows you to create and manage project clusters for your GitLab projects.
12+
For further information on clusters, consult the [gitlab
13+
documentation](https://docs.gitlab.com/ce/user/project/clusters/index.html).
14+
15+
16+
## Example Usage
17+
18+
```hcl
19+
resource "gitlab_project" "foo" {
20+
name = "foo-project"
21+
}
22+
23+
resource gitlab_project_cluster "bar" {
24+
project = "${gitlab_project.foo.id}"
25+
name = "bar-cluster"
26+
enabled = true
27+
kubernetes_api_url = "https://124.124.124"
28+
kubernetes_token = "some-token"
29+
kubernetes_ca_cert = "some-cert"
30+
kubernetes_namespace = "namespace"
31+
kubernetes_authorization_type = "rbac"
32+
environment_scope = "*"
33+
}
34+
```
35+
36+
## Argument Reference
37+
38+
The following arguments are supported:
39+
40+
* `project` - (Required, string) The id of the project to add the cluster to.
41+
42+
* `name` - (Required, string) The name of cluster.
43+
44+
* `enabled` - (Optional, boolean) Determines if cluster is active or not. Defaults to `true`.
45+
46+
* `kubernetes_api_url` - (Required, string) The URL to access the Kubernetes API.
47+
48+
* `kubernetes_token` - (Required, string) The token to authenticate against Kubernetes.
49+
50+
* `kubernetes_ca_cert` - (Optional, string) TLS certificate (needed if API is using a self-signed TLS certificate).
51+
52+
* `kubernetes_namespace` - (Optional, string) The unique namespace related to the project.
53+
54+
* `kubernetes_authorization_type` - (Optional, string) The cluster authorization type. Valid values are `rbac`, `abac`, `unknown_authorization`. Defaults to `rbac`.
55+
56+
* `environment_scope` - (Optional, string) The associated environment to the cluster. Defaults to `*`.
57+
58+
## Import
59+
60+
GitLab project clusters can be imported using an id made up of `projectid:clusterid`, e.g.
61+
62+
```
63+
$ terraform import gitlab_project_cluster.bar 123:321
64+
```

website/gitlab.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
<li<%= sidebar_current("docs-gitlab-resource-project") %>>
5050
<a href="/docs/providers/gitlab/r/project.html">gitlab_project</a>
5151
</li>
52+
<li<%= sidebar_current("docs-gitlab-resource-project_cluster") %>>
53+
<a href="/docs/providers/gitlab/r/project_cluster.html">gitlab_project_cluster</a>
54+
</li>
5255
<li<%= sidebar_current("docs-gitlab-resource-project_hook") %>>
5356
<a href="/docs/providers/gitlab/r/project_hook.html">gitlab_project_hook</a>
5457
</li>

0 commit comments

Comments
 (0)