Skip to content

Commit 1afa46c

Browse files
authored
Add map_configs variable (#7)
* Add `map_configs` variable * Add `map_configs` variable
1 parent 816af55 commit 1afa46c

File tree

12 files changed

+83
-12
lines changed

12 files changed

+83
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ No provider.
243243
| map\_config\_local\_base\_path | Base path to local YAML configuration files of map type | `string` | `""` | no |
244244
| map\_config\_paths | Paths to YAML configuration files of map type | `list(string)` | `[]` | no |
245245
| map\_config\_remote\_base\_path | Base path to remote YAML configuration files of map type | `string` | `""` | no |
246+
| map\_configs | List of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files | `any` | `[]` | no |
246247
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
247248
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
248249
| parameters | Map of parameters for interpolation within the YAML config templates | `map(string)` | `{}` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ No provider.
3030
| map\_config\_local\_base\_path | Base path to local YAML configuration files of map type | `string` | `""` | no |
3131
| map\_config\_paths | Paths to YAML configuration files of map type | `list(string)` | `[]` | no |
3232
| map\_config\_remote\_base\_path | Base path to remote YAML configuration files of map type | `string` | `""` | no |
33+
| map\_configs | List of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files | `any` | `[]` | no |
3334
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
3435
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
3536
| parameters | Map of parameters for interpolation within the YAML config templates | `map(string)` | `{}` | no |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
key3:
2+
name: name3
3+
param: param3
4+
type: type3

examples/complete/fixtures.tfvars

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,35 @@ parameters = {
1919
param1 = "1"
2020
param2 = "2"
2121
}
22+
23+
map_configs = [
24+
{
25+
key3 = {
26+
name = "name3_override"
27+
param = "param3_override"
28+
},
29+
key4 = {
30+
name = "name4"
31+
param = "param4"
32+
type = "type4"
33+
},
34+
key5 = {
35+
name = "name5"
36+
param = ["param5a", "param5b"]
37+
type = "type5"
38+
}
39+
},
40+
{
41+
key6 = {
42+
name = "name6"
43+
param = "param6"
44+
type = "type6"
45+
},
46+
key1 = [
47+
{
48+
name = "name1_override"
49+
param = "param1_override"
50+
}
51+
]
52+
}
53+
]

examples/complete/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module "yaml_config" {
99
list_config_remote_base_path = var.list_config_remote_base_path
1010
list_config_paths = var.list_config_paths
1111

12+
map_configs = var.map_configs
13+
1214
parameters = var.parameters
1315

1416
context = module.this.context

examples/complete/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ variable "remote_config_selector" {
4545
description = "String to detect local vs. remote config paths"
4646
default = "://"
4747
}
48+
49+
variable "map_configs" {
50+
type = any
51+
description = "List of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files"
52+
default = []
53+
}

examples/imports-local/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module "yaml_config" {
99
list_config_remote_base_path = var.list_config_remote_base_path
1010
list_config_paths = var.list_config_paths
1111

12+
map_configs = var.map_configs
13+
1214
parameters = var.parameters
1315

1416
context = module.this.context

examples/imports-local/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ variable "remote_config_selector" {
4545
description = "String to detect local vs. remote config paths"
4646
default = "://"
4747
}
48+
49+
variable "map_configs" {
50+
type = any
51+
description = "List of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files"
52+
default = []
53+
}

examples/imports-remote/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module "yaml_config" {
99
list_config_remote_base_path = var.list_config_remote_base_path
1010
list_config_paths = var.list_config_paths
1111

12+
map_configs = var.map_configs
13+
1214
parameters = var.parameters
1315

1416
context = module.this.context

examples/imports-remote/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ variable "remote_config_selector" {
4545
description = "String to detect local vs. remote config paths"
4646
default = "://"
4747
}
48+
49+
variable "map_configs" {
50+
type = any
51+
description = "List of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files"
52+
default = []
53+
}

0 commit comments

Comments
 (0)