diff --git a/README.md b/README.md index c54bfa4..9183280 100644 --- a/README.md +++ b/README.md @@ -133,21 +133,21 @@ module "eks_blueprints_addon" { > provided. If you are interested in contributing to EKS Blueprints, see the > [Contribution guide](https://github.com/aws-ia/terraform-aws-eks-blueprints-addon/blob/main/.github/CONTRIBUTING.md). - + ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.47 | -| [helm](#requirement\_helm) | >= 2.9 | +| [aws](#requirement\_aws) | >= 6.0 | +| [helm](#requirement\_helm) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.47 | -| [helm](#provider\_helm) | >= 2.9 | +| [aws](#provider\_aws) | >= 6.0 | +| [helm](#provider\_helm) | >= 3.0 | ## Modules @@ -201,7 +201,7 @@ No modules. | [policy\_name\_use\_prefix](#input\_policy\_name\_use\_prefix) | Determines whether the IAM policy name (`policy_name`) is used as a prefix | `bool` | `true` | no | | [policy\_path](#input\_policy\_path) | Path of IAM policy | `string` | `null` | no | | [policy\_statements](#input\_policy\_statements) | List of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) | `any` | `[]` | no | -| [postrender](#input\_postrender) | Configure a command to run after helm renders the manifest which can alter the manifest contents | `any` | `{}` | no | +| [postrender](#input\_postrender) | Configure a command to run after helm renders the manifest which can alter the manifest contents | `any` | `null` | no | | [recreate\_pods](#input\_recreate\_pods) | Perform pods restart during upgrade/rollback. Defaults to `false` | `bool` | `null` | 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, only if that name is a deleted release which remains in the history. This is unsafe in production. Defaults to `false` | `bool` | `null` | no | @@ -248,7 +248,7 @@ No modules. | [revision](#output\_revision) | Version is an int32 which represents the version of the release | | [values](#output\_values) | The compounded values from `values` and `set*` attributes | | [version](#output\_version) | A SemVer 2 conformant version string of the chart | - + ## Community diff --git a/main.tf b/main.tf index 63d4da5..911263f 100644 --- a/main.tf +++ b/main.tf @@ -43,44 +43,19 @@ resource "helm_release" "this" { dependency_update = var.dependency_update replace = var.replace lint = var.lint - - dynamic "postrender" { - for_each = length(var.postrender) > 0 ? [var.postrender] : [] - - content { - binary_path = postrender.value.binary_path - args = try(postrender.value.args, null) - } - } - - dynamic "set" { - for_each = var.set - - content { - name = set.value.name - value = set.value.value - type = try(set.value.type, null) - } - } - - dynamic "set" { - for_each = { for k, v in toset(var.set_irsa_names) : k => v if var.create && var.create_role } - iterator = each - content { - name = each.value - value = aws_iam_role.this[0].arn - } - } - - dynamic "set_sensitive" { - for_each = var.set_sensitive - - content { - name = set_sensitive.value.name - value = set_sensitive.value.value - type = try(set_sensitive.value.type, null) - } - } + postrender = var.postrender + + set = concat( + var.set, + [ + for name in var.set_irsa_names : { + name = name + value = aws_iam_role.this[0].arn + } if var.create && var.create_role + ] + ) + + set_sensitive = var.set_sensitive } ################################################################################ diff --git a/outputs.tf b/outputs.tf index 2251c79..04c4c05 100644 --- a/outputs.tf +++ b/outputs.tf @@ -4,37 +4,37 @@ output "chart" { description = "The name of the chart" - value = try(helm_release.this[0].metadata[0].chart, null) + value = try(helm_release.this[0].metadata.chart, null) } output "name" { description = "Name is the name of the release" - value = try(helm_release.this[0].metadata[0].name, null) + value = try(helm_release.this[0].metadata.name, null) } output "namespace" { description = "Name of Kubernetes namespace" - value = try(helm_release.this[0].metadata[0].namespace, null) + value = try(helm_release.this[0].metadata.namespace, null) } output "revision" { description = "Version is an int32 which represents the version of the release" - value = try(helm_release.this[0].metadata[0].revision, null) + value = try(helm_release.this[0].metadata.revision, null) } output "version" { description = "A SemVer 2 conformant version string of the chart" - value = try(helm_release.this[0].metadata[0].version, null) + value = try(helm_release.this[0].metadata.version, null) } output "app_version" { description = "The version number of the application being deployed" - value = try(helm_release.this[0].metadata[0].app_version, null) + value = try(helm_release.this[0].metadata.app_version, null) } output "values" { description = "The compounded values from `values` and `set*` attributes" - value = try(helm_release.this[0].metadata[0].values, []) + value = try(helm_release.this[0].metadata.values, []) } ################################################################################ diff --git a/tests/README.md b/tests/README.md index aa32169..b7472e7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -18,31 +18,31 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.47 | -| [helm](#requirement\_helm) | >= 2.9 | +| [aws](#requirement\_aws) | >= 6.0 | +| [helm](#requirement\_helm) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.47 | +| [aws](#provider\_aws) | >= 6.0 | ## Modules | Name | Source | Version | |------|--------|---------| | [disabled](#module\_disabled) | ../ | n/a | -| [eks](#module\_eks) | terraform-aws-modules/eks/aws | ~> 19.16 | +| [eks](#module\_eks) | terraform-aws-modules/eks/aws | ~> 21.0 | | [helm\_release\_irsa](#module\_helm\_release\_irsa) | ../ | n/a | | [helm\_release\_only](#module\_helm\_release\_only) | ../ | n/a | | [irsa\_only](#module\_irsa\_only) | ../ | n/a | -| [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 | +| [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 | ## Resources @@ -95,6 +95,6 @@ No inputs. | [irsa\_only\_revision](#output\_irsa\_only\_revision) | Version is an int32 which represents the version of the release | | [irsa\_only\_values](#output\_irsa\_only\_values) | The compounded values from `values` and `set*` attributes | | [irsa\_only\_version](#output\_irsa\_only\_version) | A SemVer 2 conformant version string of the chart | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/aws-ia/terraform-aws-eks-blueprints-addon/blob/main/LICENSE). diff --git a/tests/main.tf b/tests/main.tf index d011ed9..9e41ce8 100644 --- a/tests/main.tf +++ b/tests/main.tf @@ -3,11 +3,11 @@ provider "aws" { } provider "helm" { - kubernetes { + kubernetes = { host = module.eks.cluster_endpoint cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) - exec { + exec = { api_version = "client.authentication.k8s.io/v1beta1" command = "aws" # This requires the awscli to be installed locally where Terraform is executed @@ -151,11 +151,11 @@ module "disabled" { module "eks" { source = "terraform-aws-modules/eks/aws" - version = "~> 19.16" + version = "~> 21.0" - cluster_name = local.name - cluster_version = "1.27" - cluster_endpoint_public_access = true + name = local.name + kubernetes_version = "1.27" + endpoint_public_access = true vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets @@ -180,7 +180,7 @@ module "eks" { module "vpc" { source = "terraform-aws-modules/vpc/aws" - version = "~> 5.0" + version = "~> 6.0" name = local.name cidr = local.vpc_cidr diff --git a/tests/versions.tf b/tests/versions.tf index 7b6fd45..5150177 100644 --- a/tests/versions.tf +++ b/tests/versions.tf @@ -4,11 +4,11 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.47" + version = ">= 6.0" } helm = { source = "hashicorp/helm" - version = ">= 2.9" + version = ">= 3.0" } } } diff --git a/variables.tf b/variables.tf index ab09aaf..f8d007e 100644 --- a/variables.tf +++ b/variables.tf @@ -221,7 +221,7 @@ variable "lint" { variable "postrender" { description = "Configure a command to run after helm renders the manifest which can alter the manifest contents" type = any - default = {} + default = null } variable "set" { diff --git a/versions.tf b/versions.tf index 7b6fd45..5150177 100644 --- a/versions.tf +++ b/versions.tf @@ -4,11 +4,11 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.47" + version = ">= 6.0" } helm = { source = "hashicorp/helm" - version = ">= 2.9" + version = ">= 3.0" } } }