Skip to content

Commit

Permalink
expose append_list_enabled and deep_copy_list_enabled to root mod…
Browse files Browse the repository at this point in the history
…ule (#20)

* expose append_list and deep_copy_list

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
Benbentwo and cloudpossebot authored Apr 22, 2022
1 parent 98287f8 commit 7a1e756
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
Expand Down
2 changes: 2 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
Expand Down
20 changes: 20 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module "yaml_config_1" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -23,6 +25,8 @@ module "yaml_config_2" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -38,6 +42,8 @@ module "yaml_config_3" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -53,6 +59,8 @@ module "yaml_config_4" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -68,6 +76,8 @@ module "yaml_config_5" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -83,6 +93,8 @@ module "yaml_config_6" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -98,6 +110,8 @@ module "yaml_config_7" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -113,6 +127,8 @@ module "yaml_config_8" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -128,6 +144,8 @@ module "yaml_config_9" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand All @@ -143,6 +161,8 @@ module "yaml_config_10" {
list_config_paths = var.list_config_paths
parameters = var.parameters
remote_config_selector = var.remote_config_selector
append_list_enabled = var.append_list_enabled
deep_copy_list_enabled = var.deep_copy_list_enabled

context = module.this.context
}
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ variable "map_configs" {
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"
default = []
}

variable "append_list_enabled" {
type = bool
description = "A boolean flag to enable/disable appending lists instead of overwriting them."
default = false
}

variable "deep_copy_list_enabled" {
type = bool
description = "A boolean flag to enable/disable merging of list elements one by one."
default = false
}

0 comments on commit 7a1e756

Please sign in to comment.