Skip to content

Commit

Permalink
fix: Correct Karpenter EC2 service principal DNS suffix in non-commer…
Browse files Browse the repository at this point in the history
…cial regions (#3157)
  • Loading branch information
bryantbiggs authored Sep 16, 2024
1 parent 71d1947 commit 47ab3eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.95.0
rev: v1.96.0
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
3 changes: 2 additions & 1 deletion modules/karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ data "aws_caller_identity" "current" {}

locals {
account_id = data.aws_caller_identity.current.account_id
dns_suffix = data.aws_partition.current.dns_suffix
partition = data.aws_partition.current.partition
region = data.aws_region.current.name
}
Expand Down Expand Up @@ -286,7 +287,7 @@ data "aws_iam_policy_document" "node_assume_role" {

principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
identifiers = ["ec2.${local.dns_suffix}"]
}
}
}
Expand Down

0 comments on commit 47ab3eb

Please sign in to comment.