Skip to content

Commit 9b7e5cb

Browse files
author
Alan O'Cais
committed
Use spot specific values only when using spot instances
1 parent 0521886 commit 9b7e5cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

azure/infrastructure.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ resource "azurerm_linux_virtual_machine" "instances" {
9797

9898
priority = contains(each.value["tags"], "spot") ? "Spot" : "Regular"
9999
# Spot instances specifics
100-
max_bid_price = lookup(each.value, "max_bid_price", null)
101-
eviction_policy = lookup(each.value, "eviction_policy", "Deallocate")
100+
max_bid_price = contains(each.value["tags"], "spot") ? lookup(each.value, "max_bid_price", null) : null
101+
eviction_policy = contains(each.value["tags"], "spot") ? lookup(each.value, "eviction_policy", "Deallocate") : null
102102

103103
lifecycle {
104104
ignore_changes = [

0 commit comments

Comments
 (0)