Avoid unneeded rotations of Regular priority virtual machine scale sets
* Azure only allows `eviction_policy` to be set for Low priority VMs. Supporting Low priority VMs meant when Regular VMs were used, each `terraform apply` rolled workers, to set eviction_policy to null. * Terraform v0.12 nullable variables fix the issue and plan does not produce a diff
This commit is contained in:
parent
189487ecaa
commit
28506df9c7
|
@ -13,6 +13,9 @@ Notable changes between versions.
|
||||||
* Migrate from Terraform v0.11 to v0.12.x (**action required!**)
|
* Migrate from Terraform v0.11 to v0.12.x (**action required!**)
|
||||||
* Require `terraform-provider-azurerm` v1.27+ to support Terraform v0.12
|
* Require `terraform-provider-azurerm` v1.27+ to support Terraform v0.12
|
||||||
* Require `terraform-provider-ct` v0.3.2+ to support Terraform v0.12
|
* Require `terraform-provider-ct` v0.3.2+ to support Terraform v0.12
|
||||||
|
* Avoid unneeded rotations of Regular priority virtual machine scale sets
|
||||||
|
* Azure only allows `eviction_policy` to be set for Low priority VMs. Supporting Low priority VMs meant when Regular VMs were used, each `terraform apply` rolled workers, to set eviction_policy to null.
|
||||||
|
* Terraform v0.12 nullable variables fix the issue and plan does not produce a diff.
|
||||||
|
|
||||||
#### DigitalOcean
|
#### DigitalOcean
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,9 @@ resource "azurerm_virtual_machine_scale_set" "workers" {
|
||||||
|
|
||||||
# lifecycle
|
# lifecycle
|
||||||
upgrade_policy_mode = "Manual"
|
upgrade_policy_mode = "Manual"
|
||||||
|
# eviction policy may only be set when priority is Low
|
||||||
priority = var.priority
|
priority = var.priority
|
||||||
eviction_policy = "Delete"
|
eviction_policy = var.priority == "Low" ? "Delete" : null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scale up or down to maintain desired number, tolerating deallocations.
|
# Scale up or down to maintain desired number, tolerating deallocations.
|
||||||
|
|
Loading…
Reference in New Issue