Skip to content

Commit 137f30d

Browse files
authored
Merge pull request #14 from cookielab/jj/fix-restrict_user_defined_variables
chore: set restrict_user_defined_variables in gitlab_project to true to eliminate resource replacement
2 parents 30248fa + d6371d2 commit 137f30d

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

.terraform-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
formatter: "markdown table" # this is required
2-
version: "0.16"
2+
version: "0.19.0"
33
header-from: main.tf
44
footer-from: ""
55
recursive:

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ Basic usage of this module is as follows:
3737

3838
```hcl
3939
module "example" {
40-
source = "<module-path>"
41-
40+
source = "<module-path>"
41+
4242
# Required variables
43-
agent_name =
44-
gitlab_agent_cluster_projects =
45-
43+
agent_name =
44+
gitlab_agent_cluster_projects =
45+
4646
# Optional variables
47-
agent_config = {}
48-
agent_version = null
49-
author_email = "example@mail.com"
50-
chart_version = "1.14.1"
51-
commit_message = "feature: add/update agent config"
52-
create_namespace = false
53-
create_project = false
54-
namespace = "gitlab-agent"
55-
project_name = "k8s-agent"
56-
project_namespace = ""
57-
project_path = null
58-
token_description = ""
47+
agent_config = {}
48+
agent_version = null
49+
author_email = "example@mail.com"
50+
chart_version = "1.14.1"
51+
commit_message = "feature: add/update agent config"
52+
create_namespace = false
53+
create_project = false
54+
namespace = "gitlab-agent"
55+
project_name = "k8s-agent"
56+
project_namespace = ""
57+
project_path = null
58+
token_description = ""
5959
}
6060
```
6161

@@ -76,15 +76,15 @@ module "example" {
7676

7777
| Name | Description | Type | Default | Required |
7878
|------|-------------|------|---------|:--------:|
79-
| <a name="input_agent_config"></a> [agent\_config](#input\_agent\_config) | agent config to be used regarding:<br> * https://docs.gitlab.com/ee/user/clusters/agent/gitops.html<br> * https://docs.gitlab.com/ee/user/clusters/agent/ci_cd_workflow.html#authorize-the-agent-to-access-your-projects | `any` | `{}` | no |
79+
| <a name="input_agent_config"></a> [agent\_config](#input\_agent\_config) | agent config to be used regarding:<br/> * https://docs.gitlab.com/ee/user/clusters/agent/gitops.html<br/> * https://docs.gitlab.com/ee/user/clusters/agent/ci_cd_workflow.html#authorize-the-agent-to-access-your-projects | `any` | `{}` | no |
8080
| <a name="input_agent_name"></a> [agent\_name](#input\_agent\_name) | agent name | `string` | n/a | yes |
8181
| <a name="input_agent_version"></a> [agent\_version](#input\_agent\_version) | specific agent version | `string` | `null` | no |
8282
| <a name="input_author_email"></a> [author\_email](#input\_author\_email) | author email to be used for commit | `string` | `"example@mail.com"` | no |
8383
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | agent chart version | `string` | `"1.14.1"` | no |
8484
| <a name="input_commit_message"></a> [commit\_message](#input\_commit\_message) | use this commit message for agent config update | `string` | `"feature: add/update agent config"` | no |
8585
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | option for create namespace | `bool` | `false` | no |
8686
| <a name="input_create_project"></a> [create\_project](#input\_create\_project) | create a new agent managing project or use existing one | `bool` | `false` | no |
87-
| <a name="input_gitlab_agent_cluster_projects"></a> [gitlab\_agent\_cluster\_projects](#input\_gitlab\_agent\_cluster\_projects) | n/a | <pre>map(object({<br> envs = list(object({<br> scope = string<br> namespace = string<br> }))<br> path = string<br> }))</pre> | n/a | yes |
87+
| <a name="input_gitlab_agent_cluster_projects"></a> [gitlab\_agent\_cluster\_projects](#input\_gitlab\_agent\_cluster\_projects) | n/a | <pre>map(object({<br/> envs = list(object({<br/> scope = string<br/> namespace = string<br/> }))<br/> path = string<br/> }))</pre> | n/a | yes |
8888
| <a name="input_namespace"></a> [namespace](#input\_namespace) | agent namespace | `string` | `"gitlab-agent"` | no |
8989
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | agent managing project nice/visible name | `string` | `"k8s-agent"` | no |
9090
| <a name="input_project_namespace"></a> [project\_namespace](#input\_project\_namespace) | agent managing project namespace, required when creating new project | `string` | `""` | no |

main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ resource "gitlab_project" "this" {
3333

3434
namespace_id = data.gitlab_group.namespace[0].id
3535

36+
# `restrict_user_defined_variables` can be removed with provider constraint >=17.7
37+
restrict_user_defined_variables = true
3638
skip_wait_for_default_branch_protection = true
3739
}
3840

0 commit comments

Comments
 (0)