Skip to content

Commit

Permalink
feat: Add support for addon and identity provider custom tags (#2938)
Browse files Browse the repository at this point in the history
feat: Add support for addon and OIDC provider custom tags
  • Loading branch information
bryantbiggs authored Feb 21, 2024
1 parent 0d468bd commit f6255c4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,14 @@ resource "aws_iam_policy" "cluster_encryption" {
# EKS Addons
################################################################################

data "aws_eks_addon_version" "this" {
for_each = { for k, v in var.cluster_addons : k => v if local.create && !local.create_outposts_local_cluster }

addon_name = try(each.value.name, each.key)
kubernetes_version = coalesce(var.cluster_version, aws_eks_cluster.this[0].version)
most_recent = try(each.value.most_recent, null)
}

resource "aws_eks_addon" "this" {
# Not supported on outposts
for_each = { for k, v in var.cluster_addons : k => v if !try(v.before_compute, false) && local.create && !local.create_outposts_local_cluster }
Expand All @@ -507,7 +515,7 @@ resource "aws_eks_addon" "this" {
module.self_managed_node_group,
]

tags = var.tags
tags = merge(var.tags, try(each.value.tags, {}))
}

resource "aws_eks_addon" "before_compute" {
Expand All @@ -530,15 +538,7 @@ resource "aws_eks_addon" "before_compute" {
delete = try(each.value.timeouts.delete, var.cluster_addons_timeouts.delete, null)
}

tags = var.tags
}

data "aws_eks_addon_version" "this" {
for_each = { for k, v in var.cluster_addons : k => v if local.create && !local.create_outposts_local_cluster }

addon_name = try(each.value.name, each.key)
kubernetes_version = coalesce(var.cluster_version, aws_eks_cluster.this[0].version)
most_recent = try(each.value.most_recent, null)
tags = merge(var.tags, try(each.value.tags, {}))
}

################################################################################
Expand All @@ -562,5 +562,5 @@ resource "aws_eks_identity_provider_config" "this" {
username_prefix = lookup(each.value, "username_prefix", null)
}

tags = var.tags
tags = merge(var.tags, try(each.value.tags, {}))
}

0 comments on commit f6255c4

Please sign in to comment.