Skip to content

Commit

Permalink
fix: Remove optional variable attribute experiment from project (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs authored Oct 1, 2022
1 parent c3eaf4f commit db22d77
Show file tree
Hide file tree
Showing 30 changed files with 80 additions and 186 deletions.
2 changes: 1 addition & 1 deletion modules/kubernetes-addons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

## Providers
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/agones/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/airflow/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ locals {
# Apache Airflow Helm Add-on
#-------------------------------------------------
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context
}
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/argo-rollouts/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/argocd/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/cert-manager-csi-driver/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Cluster Proportional Autoscaler Helm Add-on
#-------------------------------------------------
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
set_values = local.set_values
irsa_config = null
addon_context = var.addon_context
}
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/crossplane/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ resource "kubernetes_namespace_v1" "crossplane" {
}

module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.crossplane]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/helm-addon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Helm Addon module can be used to provision a generic Helm Chart as an Add-On for

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | `any` | n/a | yes |
| <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 |
| <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 |
| <a name="input_irsa_config"></a> [irsa\_config](#input\_irsa\_config) | Input configuration for IRSA module | `any` | `{}` | no |
| <a name="input_irsa_iam_role_name"></a> [irsa\_iam\_role\_name](#input\_irsa\_iam\_role\_name) | IAM role name for IRSA | `string` | `""` | no |
| <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 |
| <a name="input_set_sensitive_values"></a> [set\_sensitive\_values](#input\_set\_sensitive\_values) | Forced set\_sensitive values | `any` | `[]` | no |
Expand Down
18 changes: 10 additions & 8 deletions modules/kubernetes-addons/helm-addon/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@ resource "helm_release" "addon" {
}

module "irsa" {
count = var.irsa_config != null ? 1 : 0
source = "../../irsa"
source = "../../irsa"

count = length(var.irsa_config) > 0 ? 1 : 0

create_kubernetes_namespace = try(var.irsa_config.create_kubernetes_namespace, true)
create_kubernetes_service_account = try(var.irsa_config.create_kubernetes_service_account, true)
kubernetes_namespace = var.irsa_config.kubernetes_namespace
kubernetes_service_account = var.irsa_config.kubernetes_service_account
kubernetes_svc_image_pull_secrets = var.irsa_config.kubernetes_svc_image_pull_secrets
irsa_iam_policies = var.irsa_config.irsa_iam_policies
kubernetes_namespace = lookup(var.irsa_config, "kubernetes_namespace", "")
kubernetes_service_account = lookup(var.irsa_config, "kubernetes_service_account", "")
kubernetes_svc_image_pull_secrets = try(var.irsa_config.kubernetes_svc_image_pull_secrets, null)
irsa_iam_policies = lookup(var.irsa_config, "irsa_iam_policies", null)
irsa_iam_role_name = var.irsa_iam_role_name
irsa_iam_role_path = var.addon_context.irsa_iam_role_path
irsa_iam_permissions_boundary = var.addon_context.irsa_iam_permissions_boundary
irsa_iam_role_path = lookup(var.addon_context, "irsa_iam_role_path", null)
irsa_iam_permissions_boundary = lookup(var.addon_context, "irsa_iam_permissions_boundary", null)
eks_cluster_id = var.addon_context.eks_cluster_id
eks_oidc_provider_arn = var.addon_context.eks_oidc_provider_arn
}
27 changes: 4 additions & 23 deletions modules/kubernetes-addons/helm-addon/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,18 @@ variable "manage_via_gitops" {
}

variable "irsa_iam_role_name" {
type = string
description = "IAM role name for IRSA"
type = string
default = ""
}

variable "irsa_config" {
description = "Input configuration for IRSA module"
type = object({
kubernetes_namespace = string
create_kubernetes_namespace = optional(bool)
kubernetes_service_account = string
create_kubernetes_service_account = optional(bool)
kubernetes_svc_image_pull_secrets = optional(list(string))
irsa_iam_policies = optional(list(string))
})
default = null
type = any
default = {}
}

variable "addon_context" {
description = "Input configuration for the addon"
type = object({
aws_caller_identity_account_id = string
aws_caller_identity_arn = string
aws_eks_cluster_endpoint = string
aws_partition_id = string
aws_region_name = string
eks_cluster_id = string
eks_oidc_issuer_url = string
eks_oidc_provider_arn = string
tags = map(string)
irsa_iam_role_path = optional(string)
irsa_iam_permissions_boundary = optional(string)
})
type = any
}
2 changes: 0 additions & 2 deletions modules/kubernetes-addons/helm-addon/versions.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
terraform {
required_version = ">= 1.0.0"

experiments = [module_variable_optional_attrs]

required_providers {
helm = {
source = "hashicorp/helm"
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/ingress-nginx/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#-------------------------------------

module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
1 change: 0 additions & 1 deletion modules/kubernetes-addons/kuberay-operator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ module "helm_addon" {
var.helm_config
)

irsa_config = null
addon_context = var.addon_context
}
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/kubernetes-dashboard/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/metrics-server/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
1 change: 0 additions & 1 deletion modules/kubernetes-addons/opentelemetry-operator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ module "helm_addon" {
count = var.enable_opentelemetry_operator ? 1 : 0

helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [module.cert_manager]
Expand Down
1 change: 0 additions & 1 deletion modules/kubernetes-addons/prometheus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ module "helm_addon" {
}
] : []

irsa_config = null
addon_context = var.addon_context
}

Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/reloader/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context
}
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/spark-k8s-operator/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/traefik/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.this]
Expand Down
2 changes: 1 addition & 1 deletion modules/kubernetes-addons/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.0.0, < 1.3.0"
required_version = ">= 1.0.0"

required_providers {
aws = {
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/vpa/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.vpa]
Expand Down
4 changes: 2 additions & 2 deletions modules/kubernetes-addons/yunikorn/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "helm_addon" {
source = "../helm-addon"
source = "../helm-addon"

manage_via_gitops = var.manage_via_gitops
helm_config = local.helm_config
irsa_config = null
addon_context = var.addon_context

depends_on = [kubernetes_namespace_v1.yunikorn]
Expand Down
4 changes: 2 additions & 2 deletions modules/launch-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module "launch_templates" {

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

## Providers
Expand All @@ -122,7 +122,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | EKS Cluster ID | `string` | n/a | yes |
| <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 |
| <a name="input_launch_template_config"></a> [launch\_template\_config](#input\_launch\_template\_config) | Launch template configuration | `any` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | `map(string)` | `{}` | no |

## Outputs
Expand Down
3 changes: 0 additions & 3 deletions modules/launch-templates/data.tf

This file was deleted.

45 changes: 0 additions & 45 deletions modules/launch-templates/locals.tf

This file was deleted.

Loading

0 comments on commit db22d77

Please sign in to comment.