diff --git a/README.md b/README.md index 144979f..a441832 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,7 @@ Available targets: | [postrender\_binary\_path](#input\_postrender\_binary\_path) | Relative or full path to command binary. | `string` | `null` | no | | [recreate\_pods](#input\_recreate\_pods) | Perform pods restart during upgrade/rollback. Defaults to `false`. | `bool` | `null` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | +| [release\_name](#input\_release\_name) | The name of the release to be installed. If omitted, use the name input, and if that's omitted, use the chart input. | `string` | `""` | no | | [render\_subchart\_notes](#input\_render\_subchart\_notes) | If set, render subchart notes along with the parent. Defaults to `true`. | `bool` | `null` | no | | [replace](#input\_replace) | Re-use the given name, even if that name is already used. This is unsafe in production. Defaults to `false`. | `bool` | `null` | no | | [repository](#input\_repository) | Repository URL where to locate the requested chart. | `string` | `null` | no | diff --git a/docs/terraform.md b/docs/terraform.md index 46d8ab0..8fac78d 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -69,6 +69,7 @@ | [postrender\_binary\_path](#input\_postrender\_binary\_path) | Relative or full path to command binary. | `string` | `null` | no | | [recreate\_pods](#input\_recreate\_pods) | Perform pods restart during upgrade/rollback. Defaults to `false`. | `bool` | `null` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | +| [release\_name](#input\_release\_name) | The name of the release to be installed. If omitted, use the name input, and if that's omitted, use the chart input. | `string` | `""` | no | | [render\_subchart\_notes](#input\_render\_subchart\_notes) | If set, render subchart notes along with the parent. Defaults to `true`. | `bool` | `null` | no | | [replace](#input\_replace) | Re-use the given name, even if that name is already used. This is unsafe in production. Defaults to `false`. | `bool` | `null` | no | | [repository](#input\_repository) | Repository URL where to locate the requested chart. | `string` | `null` | no | diff --git a/main.tf b/main.tf index 9209623..fd42450 100644 --- a/main.tf +++ b/main.tf @@ -37,7 +37,7 @@ resource "helm_release" "this" { # Allows var.name to be empty, which is allowed to be the case for this module since var.name is optional in eks-iam-role. # For more information, see: https://github.com/cloudposse/terraform-aws-eks-iam-role - name = coalesce(module.this.name, var.chart) + name = coalesce(var.release_name, module.this.name, var.chart) chart = var.chart description = var.description diff --git a/variables.tf b/variables.tf index 0547aa7..1676285 100644 --- a/variables.tf +++ b/variables.tf @@ -121,6 +121,12 @@ variable "chart" { description = "Chart name to be installed. The chart name can be local path, a URL to a chart, or the name of the chart if `repository` is specified. It is also possible to use the `/` format here if you are running Terraform on a system that the repository has been added to with `helm repo add` but this is not recommended." } +variable "release_name" { + type = string + description = "The name of the release to be installed. If omitted, use the name input, and if that's omitted, use the chart input." + default = "" +} + variable "description" { type = string description = "Release description attribute (visible in the history)."