Skip to content

Commit 7a1e756

Browse files
expose append_list_enabled and deep_copy_list_enabled to root module (#20)
* expose append_list and deep_copy_list * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent 98287f8 commit 7a1e756

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ No resources.
270270
| Name | Description | Type | Default | Required |
271271
|------|-------------|------|---------|:--------:|
272272
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
273+
| <a name="input_append_list_enabled"></a> [append\_list\_enabled](#input\_append\_list\_enabled) | A boolean flag to enable/disable appending lists instead of overwriting them. | `bool` | `false` | no |
273274
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
274275
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
276+
| <a name="input_deep_copy_list_enabled"></a> [deep\_copy\_list\_enabled](#input\_deep\_copy\_list\_enabled) | A boolean flag to enable/disable merging of list elements one by one. | `bool` | `false` | no |
275277
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
276278
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
277279
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |

docs/terraform.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ No resources.
3838
| Name | Description | Type | Default | Required |
3939
|------|-------------|------|---------|:--------:|
4040
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
41+
| <a name="input_append_list_enabled"></a> [append\_list\_enabled](#input\_append\_list\_enabled) | A boolean flag to enable/disable appending lists instead of overwriting them. | `bool` | `false` | no |
4142
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
4243
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
44+
| <a name="input_deep_copy_list_enabled"></a> [deep\_copy\_list\_enabled](#input\_deep\_copy\_list\_enabled) | A boolean flag to enable/disable merging of list elements one by one. | `bool` | `false` | no |
4345
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
4446
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
4547
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |

main.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ module "yaml_config_1" {
88
list_config_paths = var.list_config_paths
99
parameters = var.parameters
1010
remote_config_selector = var.remote_config_selector
11+
append_list_enabled = var.append_list_enabled
12+
deep_copy_list_enabled = var.deep_copy_list_enabled
1113

1214
context = module.this.context
1315
}
@@ -23,6 +25,8 @@ module "yaml_config_2" {
2325
list_config_paths = var.list_config_paths
2426
parameters = var.parameters
2527
remote_config_selector = var.remote_config_selector
28+
append_list_enabled = var.append_list_enabled
29+
deep_copy_list_enabled = var.deep_copy_list_enabled
2630

2731
context = module.this.context
2832
}
@@ -38,6 +42,8 @@ module "yaml_config_3" {
3842
list_config_paths = var.list_config_paths
3943
parameters = var.parameters
4044
remote_config_selector = var.remote_config_selector
45+
append_list_enabled = var.append_list_enabled
46+
deep_copy_list_enabled = var.deep_copy_list_enabled
4147

4248
context = module.this.context
4349
}
@@ -53,6 +59,8 @@ module "yaml_config_4" {
5359
list_config_paths = var.list_config_paths
5460
parameters = var.parameters
5561
remote_config_selector = var.remote_config_selector
62+
append_list_enabled = var.append_list_enabled
63+
deep_copy_list_enabled = var.deep_copy_list_enabled
5664

5765
context = module.this.context
5866
}
@@ -68,6 +76,8 @@ module "yaml_config_5" {
6876
list_config_paths = var.list_config_paths
6977
parameters = var.parameters
7078
remote_config_selector = var.remote_config_selector
79+
append_list_enabled = var.append_list_enabled
80+
deep_copy_list_enabled = var.deep_copy_list_enabled
7181

7282
context = module.this.context
7383
}
@@ -83,6 +93,8 @@ module "yaml_config_6" {
8393
list_config_paths = var.list_config_paths
8494
parameters = var.parameters
8595
remote_config_selector = var.remote_config_selector
96+
append_list_enabled = var.append_list_enabled
97+
deep_copy_list_enabled = var.deep_copy_list_enabled
8698

8799
context = module.this.context
88100
}
@@ -98,6 +110,8 @@ module "yaml_config_7" {
98110
list_config_paths = var.list_config_paths
99111
parameters = var.parameters
100112
remote_config_selector = var.remote_config_selector
113+
append_list_enabled = var.append_list_enabled
114+
deep_copy_list_enabled = var.deep_copy_list_enabled
101115

102116
context = module.this.context
103117
}
@@ -113,6 +127,8 @@ module "yaml_config_8" {
113127
list_config_paths = var.list_config_paths
114128
parameters = var.parameters
115129
remote_config_selector = var.remote_config_selector
130+
append_list_enabled = var.append_list_enabled
131+
deep_copy_list_enabled = var.deep_copy_list_enabled
116132

117133
context = module.this.context
118134
}
@@ -128,6 +144,8 @@ module "yaml_config_9" {
128144
list_config_paths = var.list_config_paths
129145
parameters = var.parameters
130146
remote_config_selector = var.remote_config_selector
147+
append_list_enabled = var.append_list_enabled
148+
deep_copy_list_enabled = var.deep_copy_list_enabled
131149

132150
context = module.this.context
133151
}
@@ -143,6 +161,8 @@ module "yaml_config_10" {
143161
list_config_paths = var.list_config_paths
144162
parameters = var.parameters
145163
remote_config_selector = var.remote_config_selector
164+
append_list_enabled = var.append_list_enabled
165+
deep_copy_list_enabled = var.deep_copy_list_enabled
146166

147167
context = module.this.context
148168
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,15 @@ variable "map_configs" {
5151
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"
5252
default = []
5353
}
54+
55+
variable "append_list_enabled" {
56+
type = bool
57+
description = "A boolean flag to enable/disable appending lists instead of overwriting them."
58+
default = false
59+
}
60+
61+
variable "deep_copy_list_enabled" {
62+
type = bool
63+
description = "A boolean flag to enable/disable merging of list elements one by one."
64+
default = false
65+
}

0 commit comments

Comments
 (0)