'Terraform Reserved VM Instances on Azure
I am trying to create a windows VM in Azure using Terraform. However, I can't seem to find any documentation on how to create the VM as a reserved instance for a 1 or 3 year plan.
Does anyone know if this is even doable with Terraform?
Solution 1:[1]
Azure Reserved instances are applied through billing. There isn't a technical mechanism for selecting a reserved instance. It is easily confused for how AWS applies reserved instances.
On the surface it is fairly simply, you pay for a reservation and it gets applied.
After you buy an Azure Reserved Virtual Machine Instance, the reservation discount is automatically applied to virtual machines that match the attributes and quantity of the reservation. A reservation covers the compute costs of your virtual machines.
But it can get fairly nuanced as you read through the documentation
Solution 2:[2]
I'm not an expert of azure and terraform but as far as i can see reservation are linked to subscription or to a resource group, so maybe you could configure it after resource creation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Christian Pearce |
| Solution 2 | Michele S |
