mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-29 13:41:47 +02:00
fix: Add support for overriding DNS suffix for cluster IAM role service principal endpoint (#1905)
This commit is contained in:
6
main.tf
6
main.tf
@@ -172,6 +172,10 @@ resource "aws_iam_openid_connect_provider" "oidc_provider" {
|
||||
locals {
|
||||
iam_role_name = coalesce(var.iam_role_name, "${var.cluster_name}-cluster")
|
||||
policy_arn_prefix = "arn:${data.aws_partition.current.partition}:iam::aws:policy"
|
||||
|
||||
# TODO - hopefully this can be removed once the AWS endpoint is named properly in China
|
||||
# https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1904
|
||||
dns_suffix = coalesce(var.cluster_iam_role_dns_suffix, data.aws_partition.current.dns_suffix)
|
||||
}
|
||||
|
||||
data "aws_iam_policy_document" "assume_role_policy" {
|
||||
@@ -183,7 +187,7 @@ data "aws_iam_policy_document" "assume_role_policy" {
|
||||
|
||||
principals {
|
||||
type = "Service"
|
||||
identifiers = ["eks.${data.aws_partition.current.dns_suffix}"]
|
||||
identifiers = ["eks.${local.dns_suffix}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user