Skip to content

Commit db22d77

Browse files
authored
fix: Remove optional variable attribute experiment from project (#1011)
1 parent c3eaf4f commit db22d77

File tree

30 files changed

+80
-186
lines changed

30 files changed

+80
-186
lines changed

modules/kubernetes-addons/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
| Name | Version |
77
|------|---------|
8-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0, < 1.3.0 |
8+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
99
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.72 |
1010

1111
## Providers

modules/kubernetes-addons/agones/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/airflow/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ locals {
1919
# Apache Airflow Helm Add-on
2020
#-------------------------------------------------
2121
module "helm_addon" {
22-
source = "../helm-addon"
22+
source = "../helm-addon"
23+
2324
helm_config = local.helm_config
24-
irsa_config = null
2525
addon_context = var.addon_context
2626
}

modules/kubernetes-addons/argo-rollouts/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/argocd/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
helm_config = local.helm_config
4-
irsa_config = null
55
addon_context = var.addon_context
66

77
depends_on = [kubernetes_namespace_v1.this]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77
}

modules/kubernetes-addons/cluster-proportional-autoscaler/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Cluster Proportional Autoscaler Helm Add-on
33
#-------------------------------------------------
44
module "helm_addon" {
5-
source = "../helm-addon"
5+
source = "../helm-addon"
6+
67
manage_via_gitops = var.manage_via_gitops
78
helm_config = local.helm_config
89
set_values = local.set_values
9-
irsa_config = null
1010
addon_context = var.addon_context
1111
}

modules/kubernetes-addons/crossplane/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ resource "kubernetes_namespace_v1" "crossplane" {
66
}
77

88
module "helm_addon" {
9-
source = "../helm-addon"
9+
source = "../helm-addon"
10+
1011
helm_config = local.helm_config
11-
irsa_config = null
1212
addon_context = var.addon_context
1313

1414
depends_on = [kubernetes_namespace_v1.crossplane]

modules/kubernetes-addons/helm-addon/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Helm Addon module can be used to provision a generic Helm Chart as an Add-On for
3737

3838
| Name | Description | Type | Default | Required |
3939
|------|-------------|------|---------|:--------:|
40-
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | <pre>object({<br> aws_caller_identity_account_id = string<br> aws_caller_identity_arn = string<br> aws_eks_cluster_endpoint = string<br> aws_partition_id = string<br> aws_region_name = string<br> eks_cluster_id = string<br> eks_oidc_issuer_url = string<br> eks_oidc_provider_arn = string<br> tags = map(string)<br> irsa_iam_role_path = optional(string)<br> irsa_iam_permissions_boundary = optional(string)<br> })</pre> | n/a | yes |
40+
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | `any` | n/a | yes |
4141
| <a name="input_helm_config"></a> [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 |
42-
| <a name="input_irsa_config"></a> [irsa\_config](#input\_irsa\_config) | Input configuration for IRSA module | <pre>object({<br> kubernetes_namespace = string<br> create_kubernetes_namespace = optional(bool)<br> kubernetes_service_account = string<br> create_kubernetes_service_account = optional(bool)<br> kubernetes_svc_image_pull_secrets = optional(list(string))<br> irsa_iam_policies = optional(list(string))<br> })</pre> | `null` | no |
42+
| <a name="input_irsa_config"></a> [irsa\_config](#input\_irsa\_config) | Input configuration for IRSA module | `any` | `{}` | no |
4343
| <a name="input_irsa_iam_role_name"></a> [irsa\_iam\_role\_name](#input\_irsa\_iam\_role\_name) | IAM role name for IRSA | `string` | `""` | no |
4444
| <a name="input_manage_via_gitops"></a> [manage\_via\_gitops](#input\_manage\_via\_gitops) | Determines if the add-on should be managed via GitOps | `bool` | `false` | no |
4545
| <a name="input_set_sensitive_values"></a> [set\_sensitive\_values](#input\_set\_sensitive\_values) | Forced set\_sensitive values | `any` | `[]` | no |

modules/kubernetes-addons/helm-addon/main.tf

+10-8
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,19 @@ resource "helm_release" "addon" {
6161
}
6262

6363
module "irsa" {
64-
count = var.irsa_config != null ? 1 : 0
65-
source = "../../irsa"
64+
source = "../../irsa"
65+
66+
count = length(var.irsa_config) > 0 ? 1 : 0
67+
6668
create_kubernetes_namespace = try(var.irsa_config.create_kubernetes_namespace, true)
6769
create_kubernetes_service_account = try(var.irsa_config.create_kubernetes_service_account, true)
68-
kubernetes_namespace = var.irsa_config.kubernetes_namespace
69-
kubernetes_service_account = var.irsa_config.kubernetes_service_account
70-
kubernetes_svc_image_pull_secrets = var.irsa_config.kubernetes_svc_image_pull_secrets
71-
irsa_iam_policies = var.irsa_config.irsa_iam_policies
70+
kubernetes_namespace = lookup(var.irsa_config, "kubernetes_namespace", "")
71+
kubernetes_service_account = lookup(var.irsa_config, "kubernetes_service_account", "")
72+
kubernetes_svc_image_pull_secrets = try(var.irsa_config.kubernetes_svc_image_pull_secrets, null)
73+
irsa_iam_policies = lookup(var.irsa_config, "irsa_iam_policies", null)
7274
irsa_iam_role_name = var.irsa_iam_role_name
73-
irsa_iam_role_path = var.addon_context.irsa_iam_role_path
74-
irsa_iam_permissions_boundary = var.addon_context.irsa_iam_permissions_boundary
75+
irsa_iam_role_path = lookup(var.addon_context, "irsa_iam_role_path", null)
76+
irsa_iam_permissions_boundary = lookup(var.addon_context, "irsa_iam_permissions_boundary", null)
7577
eks_cluster_id = var.addon_context.eks_cluster_id
7678
eks_oidc_provider_arn = var.addon_context.eks_oidc_provider_arn
7779
}

modules/kubernetes-addons/helm-addon/variables.tf

+4-23
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,18 @@ variable "manage_via_gitops" {
2222
}
2323

2424
variable "irsa_iam_role_name" {
25-
type = string
2625
description = "IAM role name for IRSA"
26+
type = string
2727
default = ""
2828
}
2929

3030
variable "irsa_config" {
3131
description = "Input configuration for IRSA module"
32-
type = object({
33-
kubernetes_namespace = string
34-
create_kubernetes_namespace = optional(bool)
35-
kubernetes_service_account = string
36-
create_kubernetes_service_account = optional(bool)
37-
kubernetes_svc_image_pull_secrets = optional(list(string))
38-
irsa_iam_policies = optional(list(string))
39-
})
40-
default = null
32+
type = any
33+
default = {}
4134
}
4235

4336
variable "addon_context" {
4437
description = "Input configuration for the addon"
45-
type = object({
46-
aws_caller_identity_account_id = string
47-
aws_caller_identity_arn = string
48-
aws_eks_cluster_endpoint = string
49-
aws_partition_id = string
50-
aws_region_name = string
51-
eks_cluster_id = string
52-
eks_oidc_issuer_url = string
53-
eks_oidc_provider_arn = string
54-
tags = map(string)
55-
irsa_iam_role_path = optional(string)
56-
irsa_iam_permissions_boundary = optional(string)
57-
})
38+
type = any
5839
}

modules/kubernetes-addons/helm-addon/versions.tf

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
terraform {
22
required_version = ">= 1.0.0"
33

4-
experiments = [module_variable_optional_attrs]
5-
64
required_providers {
75
helm = {
86
source = "hashicorp/helm"

modules/kubernetes-addons/ingress-nginx/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#-------------------------------------
44

55
module "helm_addon" {
6-
source = "../helm-addon"
6+
source = "../helm-addon"
7+
78
manage_via_gitops = var.manage_via_gitops
89
helm_config = local.helm_config
9-
irsa_config = null
1010
addon_context = var.addon_context
1111

1212
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/kuberay-operator/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ module "helm_addon" {
2323
var.helm_config
2424
)
2525

26-
irsa_config = null
2726
addon_context = var.addon_context
2827
}

modules/kubernetes-addons/kubernetes-dashboard/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/metrics-server/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/opentelemetry-operator/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ module "helm_addon" {
292292
count = var.enable_opentelemetry_operator ? 1 : 0
293293

294294
helm_config = local.helm_config
295-
irsa_config = null
296295
addon_context = var.addon_context
297296

298297
depends_on = [module.cert_manager]

modules/kubernetes-addons/prometheus/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ module "helm_addon" {
6161
}
6262
] : []
6363

64-
irsa_config = null
6564
addon_context = var.addon_context
6665
}
6766

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77
}

modules/kubernetes-addons/spark-k8s-operator/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/traefik/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.this]

modules/kubernetes-addons/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.0.0, < 1.3.0"
2+
required_version = ">= 1.0.0"
33

44
required_providers {
55
aws = {

modules/kubernetes-addons/vpa/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.vpa]

modules/kubernetes-addons/yunikorn/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module "helm_addon" {
2-
source = "../helm-addon"
2+
source = "../helm-addon"
3+
34
manage_via_gitops = var.manage_via_gitops
45
helm_config = local.helm_config
5-
irsa_config = null
66
addon_context = var.addon_context
77

88
depends_on = [kubernetes_namespace_v1.yunikorn]

modules/launch-templates/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module "launch_templates" {
9797

9898
| Name | Version |
9999
|------|---------|
100-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0, < 1.3.0 |
100+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
101101
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.72 |
102102

103103
## Providers
@@ -122,7 +122,7 @@ No modules.
122122
| Name | Description | Type | Default | Required |
123123
|------|-------------|------|---------|:--------:|
124124
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | EKS Cluster ID | `string` | n/a | yes |
125-
| <a name="input_launch_template_config"></a> [launch\_template\_config](#input\_launch\_template\_config) | Launch template configuration | <pre>map(object({<br> ami = string<br> launch_template_os = optional(string)<br> launch_template_prefix = string<br> instance_type = optional(string)<br> capacity_type = optional(string)<br> iam_instance_profile = optional(string)<br> vpc_security_group_ids = optional(list(string)) # conflicts with network_interfaces<br><br> network_interfaces = optional(list(object({<br> public_ip = optional(bool)<br> security_groups = optional(list(string))<br> })))<br><br> block_device_mappings = list(object({<br> device_name = string<br> volume_type = string<br> volume_size = string<br> delete_on_termination = optional(bool)<br> encrypted = optional(bool)<br> kms_key_id = optional(string)<br> iops = optional(string)<br> throughput = optional(string)<br> }))<br><br> format_mount_nvme_disk = optional(bool)<br> pre_userdata = optional(string)<br> bootstrap_extra_args = optional(string)<br> post_userdata = optional(string)<br> kubelet_extra_args = optional(string)<br><br> enable_metadata_options = optional(bool)<br> http_endpoint = optional(string)<br> http_tokens = optional(string)<br> http_put_response_hop_limit = optional(number)<br> http_protocol_ipv6 = optional(string)<br> instance_metadata_tags = optional(string)<br><br> service_ipv6_cidr = optional(string)<br> service_ipv4_cidr = optional(string)<br><br> monitoring = optional(bool)<br> }))</pre> | n/a | yes |
125+
| <a name="input_launch_template_config"></a> [launch\_template\_config](#input\_launch\_template\_config) | Launch template configuration | `any` | n/a | yes |
126126
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | `map(string)` | `{}` | no |
127127

128128
## Outputs

modules/launch-templates/data.tf

-3
This file was deleted.

modules/launch-templates/locals.tf

-45
This file was deleted.

0 commit comments

Comments
 (0)