mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-14 06:15:24 +01:00
fix: Karpenter enable_spot_termination = false should not result in an error (#2907)
* Add condition for statement if enable_spot_termination is true * Update modules/karpenter/main.tf --------- Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
This commit is contained in:
@@ -252,9 +252,12 @@ data "aws_iam_policy_document" "controller" {
|
|||||||
actions = ["pricing:GetProducts"]
|
actions = ["pricing:GetProducts"]
|
||||||
}
|
}
|
||||||
|
|
||||||
statement {
|
dynamic "statement" {
|
||||||
|
for_each = local.enable_spot_termination ? [1] : []
|
||||||
|
|
||||||
|
content {
|
||||||
sid = "AllowInterruptionQueueActions"
|
sid = "AllowInterruptionQueueActions"
|
||||||
resources = [aws_sqs_queue.this[0].arn]
|
resources = [try(aws_sqs_queue.this[0].arn, null)]
|
||||||
actions = [
|
actions = [
|
||||||
"sqs:DeleteMessage",
|
"sqs:DeleteMessage",
|
||||||
"sqs:GetQueueAttributes",
|
"sqs:GetQueueAttributes",
|
||||||
@@ -262,6 +265,7 @@ data "aws_iam_policy_document" "controller" {
|
|||||||
"sqs:ReceiveMessage"
|
"sqs:ReceiveMessage"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
statement {
|
statement {
|
||||||
sid = "AllowPassingInstanceRole"
|
sid = "AllowPassingInstanceRole"
|
||||||
|
|||||||
Reference in New Issue
Block a user