mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 16:47:20 +01:00
fix: Correct Karpenter EC2 service principal DNS suffix in non-commercial regions (#3157)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
||||||
rev: v1.95.0
|
rev: v1.96.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: terraform_fmt
|
- id: terraform_fmt
|
||||||
- id: terraform_docs
|
- id: terraform_docs
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ data "aws_caller_identity" "current" {}
|
|||||||
|
|
||||||
locals {
|
locals {
|
||||||
account_id = data.aws_caller_identity.current.account_id
|
account_id = data.aws_caller_identity.current.account_id
|
||||||
|
dns_suffix = data.aws_partition.current.dns_suffix
|
||||||
partition = data.aws_partition.current.partition
|
partition = data.aws_partition.current.partition
|
||||||
region = data.aws_region.current.name
|
region = data.aws_region.current.name
|
||||||
}
|
}
|
||||||
@@ -286,7 +287,7 @@ data "aws_iam_policy_document" "node_assume_role" {
|
|||||||
|
|
||||||
principals {
|
principals {
|
||||||
type = "Service"
|
type = "Service"
|
||||||
identifiers = ["ec2.amazonaws.com"]
|
identifiers = ["ec2.${local.dns_suffix}"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user