From 7012a1cc399853fee05e11958439de053e72c85e Mon Sep 17 00:00:00 2001 From: Uchinda Padmaperuma <89894943+uchinda-sph@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:33:54 +0800 Subject: [PATCH] feat: update the provider versions and add set_list attribute --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ main.tf | 10 ++++++++++ variables.tf | 5 +++++ versions.tf | 4 ++-- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b92027a..ec924f8 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,51 @@ Helm release module can be used to provision a generic Helm Chart as an Add-On f | [helm\_release](#output\_helm\_release) | Map of attributes of the Helm release created without sensitive outputs | | [release\_metadata](#output\_release\_metadata) | Map of attributes of the Helm release metadata | + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.3.0 | +| [helm](#requirement\_helm) | >= 2.15.0 | +| [kubernetes](#requirement\_kubernetes) | >= 2.32.0 | + +## Providers + +| Name | Version | +|------|---------| +| [helm](#provider\_helm) | >= 2.15.0 | +| [kubernetes](#provider\_kubernetes) | >= 2.32.0 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [irsa\_role](#module\_irsa\_role) | terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks | ~> 5.5.0 | + +## Resources + +| Name | Type | +|------|------| +| [helm_release.this](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | +| [kubernetes_namespace.irsa](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | +| [kubernetes_service_account.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [helm\_config](#input\_helm\_config) | Helm chart config. Repository and version required. See https://registry.terraform.io/providers/hashicorp/helm/latest/docs | `any` | n/a | yes | +| [irsa\_config](#input\_irsa\_config) | Input configuration for IRSA module |
object({| `{}` | no | +| [set\_list\_values](#input\_set\_list\_values) | Forced set\_list values | `any` | `[]` | no | +| [set\_sensitive\_values](#input\_set\_sensitive\_values) | Forced set\_sensitive values | `any` | `[]` | no | +| [set\_values](#input\_set\_values) | Forced set values | `any` | `[]` | no | +| [tags](#input\_tags) | A map of tags to add the the IAM role | `map(string)` | `{}` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [helm\_release](#output\_helm\_release) | Map of attributes of the Helm release created without sensitive outputs | +| [release\_metadata](#output\_release\_metadata) | Map of attributes of the Helm release metadata | + diff --git a/main.tf b/main.tf index e68f4b7..2d0ec84 100644 --- a/main.tf +++ b/main.tf @@ -63,6 +63,16 @@ resource "helm_release" "this" { } } + dynamic "set_list" { + iterator = each_item + for_each = try(var.helm_config.set_list, null) != null ? concat(var.helm_config.set_list, var.set_list_values) : var.set_list_values + + content { + name = each_item.value.name + value = each_item.value.value + } + } + postrender { binary_path = try(var.helm_config.postrender, "") } diff --git a/variables.tf b/variables.tf index 3ff40ce..caad992 100644 --- a/variables.tf +++ b/variables.tf @@ -18,6 +18,11 @@ variable "set_sensitive_values" { default = [] } +variable "set_list_values" { + description = "Forced set_list values" + type = any + default = [] +} ####### # IRSA ####### diff --git a/versions.tf b/versions.tf index 998828a..3b30d9a 100644 --- a/versions.tf +++ b/versions.tf @@ -4,11 +4,11 @@ terraform { required_providers { helm = { source = "hashicorp/helm" - version = ">= 2.7.1" + version = ">= 2.15.0" } kubernetes = { source = "hashicorp/kubernetes" - version = ">= 2.15.0" + version = ">= 2.32.0" } } }
role_name = optional(string, "")
role_policy_arns = optional(map(string), {})
create_kubernetes_namespace = optional(bool, false)
create_kubernetes_service_account = optional(bool, false)
kubernetes_namespace = optional(string, "")
kubernetes_service_account = optional(string, "")
oidc_providers = optional(any, null)
})