@@ -552,6 +552,14 @@ resource "aws_eks_addon" "before_compute" {
552
552
# Note - this is different from IRSA
553
553
# ###############################################################################
554
554
555
+ locals {
556
+ # Maintain current behavior for <= 1.29, remove default for >= 1.30
557
+ # `null` will return the latest Kubernetes version from the EKS API, which at time of writing is 1.30
558
+ # https://github.com/kubernetes/kubernetes/pull/123561
559
+ idpc_backwards_compat_version = contains ([" 1.21" , " 1.22" , " 1.23" , " 1.24" , " 1.25" , " 1.26" , " 1.27" , " 1.28" , " 1.29" ], coalesce (var. cluster_version , " 1.30" ))
560
+ idpc_issuer_url = local. idpc_backwards_compat_version ? try (aws_eks_cluster. this [0 ]. identity [0 ]. oidc [0 ]. issuer , null ) : null
561
+ }
562
+
555
563
resource "aws_eks_identity_provider_config" "this" {
556
564
for_each = { for k , v in var . cluster_identity_providers : k => v if local . create && ! local . create_outposts_local_cluster }
557
565
@@ -562,10 +570,11 @@ resource "aws_eks_identity_provider_config" "this" {
562
570
groups_claim = lookup (each. value , " groups_claim" , null )
563
571
groups_prefix = lookup (each. value , " groups_prefix" , null )
564
572
identity_provider_config_name = try (each. value . identity_provider_config_name , each. key )
565
- issuer_url = try (each. value . issuer_url , aws_eks_cluster. this [0 ]. identity [0 ]. oidc [0 ]. issuer )
566
- required_claims = lookup (each. value , " required_claims" , null )
567
- username_claim = lookup (each. value , " username_claim" , null )
568
- username_prefix = lookup (each. value , " username_prefix" , null )
573
+ # TODO - make argument explicitly required on next breaking change
574
+ issuer_url = try (each. value . issuer_url , local. idpc_issuer_url )
575
+ required_claims = lookup (each. value , " required_claims" , null )
576
+ username_claim = lookup (each. value , " username_claim" , null )
577
+ username_prefix = lookup (each. value , " username_prefix" , null )
569
578
}
570
579
571
580
tags = merge (var. tags , try (each. value . tags , {}))
0 commit comments