Skip to content

Commit f25ad9a

Browse files
committed
feat: Allow configuring helm chart with 'values[...]' and 'set{...}'
1 parent b163ae9 commit f25ad9a

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,38 @@ Type: `string`
8282

8383
Default: `""`
8484

85+
### set-list
86+
87+
Description: A list of settings to apply to on the helm chart using its parameter 'set { }'. Example:
88+
```
89+
set-list = [
90+
{
91+
"name" = "prometheus.enabled",
92+
"value" = "false",
93+
"type" = "auto"
94+
},
95+
]
96+
```
97+
98+
Type: `list(object({name = string, value = string, type = string}))`
99+
100+
Default: `[]`
101+
102+
### values
103+
104+
Description: A list of values to apply on the helm chart using its parameter 'values = [...]'. Example:
105+
```
106+
values = [
107+
"<yaml>",
108+
]
109+
```
110+
111+
Type: `list(string)`
112+
113+
Default: `[]`
114+
115+
###
116+
85117
## Outputs
86118

87119
No outputs.

main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ resource "helm_release" "cert-manager" {
1616
name = "installCRDs"
1717
value = "true"
1818
}
19+
20+
dynamic "set" {
21+
for_each = var.set-list
22+
content {
23+
name = lookup(set.value, "name", null)
24+
value = lookup(set.value, "value", null)
25+
type = lookup(set.value, "type", null)
26+
}
27+
}
28+
29+
values = var.values
30+
1931
}
2032

2133
locals {

vars.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@ variable "cluster-issuers-yaml" {
2121
default = ""
2222
description = "The YAML code to define cluster issuers for cert-manager. Example: https://github.com/adfinis-sygroup/helm-charts/blob/master/charts/cert-manager-issuers/examples/letsencrypt-clusterissuers.yaml"
2323
}
24+
25+
variable "set-list" {
26+
type = list(object({
27+
name = string,
28+
value = string,
29+
type = string,
30+
}))
31+
default = []
32+
description = "A list of settings to apply to on the helm chart using its parameter 'set { }' "
33+
}
34+
35+
variable "values" {
36+
type = list(string)
37+
default = []
38+
description = "A list of values to apply on the helm chart using its parameter 'values = [...]' "
39+
}

0 commit comments

Comments
 (0)