From a0244ff8f46ad0325acddf4802bd6776fdda2ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Jagie=C5=82=C5=82o?= Date: Fri, 16 Apr 2021 12:23:36 +0200 Subject: [PATCH] Migrate away from the deprecated list function (#28) Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> --- README.md | 36 ++++++++++++++++++------------------ docs/terraform.md | 36 ++++++++++++++++++------------------ main.tf | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 90aac82..6e0737e 100644 --- a/README.md +++ b/README.md @@ -249,15 +249,15 @@ Available targets: | Name | Version | |------|---------| -| terraform | >= 0.13.0 | +| [terraform](#requirement\_terraform) | >= 0.13.0 | ## Providers -No provider. +No providers. ## Modules -No Modules. +No modules. ## Resources @@ -267,26 +267,26 @@ No resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | -| convert\_case | Convert fields to lower case | `bool` | `true` | no | -| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | -| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no | -| name | Solution name, e.g. `app` or `jenkins` | `string` | `""` | no | -| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | -| stage | Stage, e.g. 'prod', 'staging', 'dev' | `string` | `""` | no | -| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | `map(string)` | `{}` | no | +| [attributes](#input\_attributes) | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | +| [convert\_case](#input\_convert\_case) | Convert fields to lower case | `bool` | `true` | no | +| [delimiter](#input\_delimiter) | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | +| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `true` | no | +| [name](#input\_name) | Solution name, e.g. `app` or `jenkins` | `string` | `""` | no | +| [namespace](#input\_namespace) | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | +| [stage](#input\_stage) | Stage, e.g. 'prod', 'staging', 'dev' | `string` | `""` | no | +| [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | `map(string)` | `{}` | no | ## Outputs | Name | Description | |------|-------------| -| attributes | Normalized attributes | -| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | -| id | Disambiguated ID | -| name | Normalized name | -| namespace | Normalized namespace | -| stage | Normalized stage | -| tags | Normalized Tag map | +| [attributes](#output\_attributes) | Normalized attributes | +| [delimiter](#output\_delimiter) | Delimiter between `namespace`, `stage`, `name` and `attributes` | +| [id](#output\_id) | Disambiguated ID | +| [name](#output\_name) | Normalized name | +| [namespace](#output\_namespace) | Normalized namespace | +| [stage](#output\_stage) | Normalized stage | +| [tags](#output\_tags) | Normalized Tag map | diff --git a/docs/terraform.md b/docs/terraform.md index 1881eb0..2093e56 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -3,15 +3,15 @@ | Name | Version | |------|---------| -| terraform | >= 0.13.0 | +| [terraform](#requirement\_terraform) | >= 0.13.0 | ## Providers -No provider. +No providers. ## Modules -No Modules. +No modules. ## Resources @@ -21,24 +21,24 @@ No resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | -| convert\_case | Convert fields to lower case | `bool` | `true` | no | -| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | -| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no | -| name | Solution name, e.g. `app` or `jenkins` | `string` | `""` | no | -| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | -| stage | Stage, e.g. 'prod', 'staging', 'dev' | `string` | `""` | no | -| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | `map(string)` | `{}` | no | +| [attributes](#input\_attributes) | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | +| [convert\_case](#input\_convert\_case) | Convert fields to lower case | `bool` | `true` | no | +| [delimiter](#input\_delimiter) | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | +| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `true` | no | +| [name](#input\_name) | Solution name, e.g. `app` or `jenkins` | `string` | `""` | no | +| [namespace](#input\_namespace) | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `""` | no | +| [stage](#input\_stage) | Stage, e.g. 'prod', 'staging', 'dev' | `string` | `""` | no | +| [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | `map(string)` | `{}` | no | ## Outputs | Name | Description | |------|-------------| -| attributes | Normalized attributes | -| delimiter | Delimiter between `namespace`, `stage`, `name` and `attributes` | -| id | Disambiguated ID | -| name | Normalized name | -| namespace | Normalized namespace | -| stage | Normalized stage | -| tags | Normalized Tag map | +| [attributes](#output\_attributes) | Normalized attributes | +| [delimiter](#output\_delimiter) | Delimiter between `namespace`, `stage`, `name` and `attributes` | +| [id](#output\_id) | Disambiguated ID | +| [name](#output\_name) | Normalized name | +| [namespace](#output\_namespace) | Normalized namespace | +| [stage](#output\_stage) | Normalized stage | +| [tags](#output\_tags) | Normalized Tag map | diff --git a/main.tf b/main.tf index da25f41..935b97d 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ locals { - original_tags = join(var.delimiter, compact(concat(list(var.namespace, var.stage, var.name), var.attributes))) + original_tags = join(var.delimiter, compact(concat(tolist([var.namespace, var.stage, var.name]), var.attributes))) transformed_tags = var.convert_case ? lower(local.original_tags) : local.original_tags }