Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ data "aws_iam_policy_document" "kms_ebs" {

principals {
type = "AWS"
identifiers = [
local.asg_role, # required for the ASG to manage encrypted volumes for nodes
aws_iam_role.cluster.arn, # required for the cluster / persistentvolume-controller to create encrypted PVCs
]
identifiers = flatten([
var.autoscaling_mode != "karpenter" ? local.asg_role : "", # required for the ASG to manage encrypted volumes for nodes
aws_iam_role.cluster.arn, # required for the cluster / persistentvolume-controller to create encrypted PVCs
])
}
}

Expand All @@ -55,10 +55,10 @@ data "aws_iam_policy_document" "kms_ebs" {

principals {
type = "AWS"
identifiers = [
local.asg_role, # required for the ASG to manage encrypted volumes for nodes
aws_iam_role.cluster.arn, # required for the cluster / persistentvolume-controller to create encrypted PVCs
]
identifiers = flatten([
var.autoscaling_mode != "karpenter" ? local.asg_role : "", # required for the ASG to manage encrypted volumes for nodes
aws_iam_role.cluster.arn, # required for the cluster / persistentvolume-controller to create encrypted PVCs
])
}

condition {
Expand Down
Loading