fix: Replace Karpenter SQS policy dynamic service princpal DNS suffixes with static amazonaws.com (#2941)

fix: Replace dynamic service princpal DNS suffixes with static `amazonaws.com`
This commit is contained in:
Bryant Biggs
2024-02-21 17:30:49 -05:00
committed by GitHub
parent d63fd61e89
commit 081c7624a5
2 changed files with 3 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform - repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0 rev: v1.87.1
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate - id: terraform_validate

View File

@@ -4,7 +4,6 @@ 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
} }
@@ -445,8 +444,8 @@ data "aws_iam_policy_document" "queue" {
principals { principals {
type = "Service" type = "Service"
identifiers = [ identifiers = [
"events.${local.dns_suffix}", "events.amazonaws.com",
"sqs.${local.dns_suffix}", "sqs.amazonaws.com",
] ]
} }
} }