mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-15 16:23:58 +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,15 +252,19 @@ data "aws_iam_policy_document" "controller" {
|
|||||||
actions = ["pricing:GetProducts"]
|
actions = ["pricing:GetProducts"]
|
||||||
}
|
}
|
||||||
|
|
||||||
statement {
|
dynamic "statement" {
|
||||||
sid = "AllowInterruptionQueueActions"
|
for_each = local.enable_spot_termination ? [1] : []
|
||||||
resources = [aws_sqs_queue.this[0].arn]
|
|
||||||
actions = [
|
content {
|
||||||
"sqs:DeleteMessage",
|
sid = "AllowInterruptionQueueActions"
|
||||||
"sqs:GetQueueAttributes",
|
resources = [try(aws_sqs_queue.this[0].arn, null)]
|
||||||
"sqs:GetQueueUrl",
|
actions = [
|
||||||
"sqs:ReceiveMessage"
|
"sqs:DeleteMessage",
|
||||||
]
|
"sqs:GetQueueAttributes",
|
||||||
|
"sqs:GetQueueUrl",
|
||||||
|
"sqs:ReceiveMessage"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
statement {
|
statement {
|
||||||
|
|||||||
Reference in New Issue
Block a user