File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -252,15 +252,19 @@ data "aws_iam_policy_document" "controller" {
252
252
actions = [" pricing:GetProducts" ]
253
253
}
254
254
255
- statement {
256
- sid = " AllowInterruptionQueueActions"
257
- resources = [aws_sqs_queue . this [0 ]. arn ]
258
- actions = [
259
- " sqs:DeleteMessage" ,
260
- " sqs:GetQueueAttributes" ,
261
- " sqs:GetQueueUrl" ,
262
- " sqs:ReceiveMessage"
263
- ]
255
+ dynamic "statement" {
256
+ for_each = local. enable_spot_termination ? [1 ] : []
257
+
258
+ content {
259
+ sid = " AllowInterruptionQueueActions"
260
+ resources = [try (aws_sqs_queue. this [0 ]. arn , null )]
261
+ actions = [
262
+ " sqs:DeleteMessage" ,
263
+ " sqs:GetQueueAttributes" ,
264
+ " sqs:GetQueueUrl" ,
265
+ " sqs:ReceiveMessage"
266
+ ]
267
+ }
264
268
}
265
269
266
270
statement {
You can’t perform that action at this time.
0 commit comments