Terraform not applying changes to Azure VM size due to unexpected dependency issues
I'm learning this framework and I'm trying to debug I'm working on a project and hit a roadblock..... I'm currently working with an scenario with Terraform where it refuses to apply changes to the size of an Azure VM. I have a configuration that defines a VM and an associated network interface. When I attempt to change the size of the VM from `Standard_DS1_v2` to `Standard_DS2_v2`, the following behavior occurs: ``` behavior: behavior updating Virtual Machine 'my-vm' (Resource Group 'my-resource-group'): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original behavior: Code="InvalidParameter" Message="The specified VM size is not available in the specified location." ``` I've double-checked the available VM sizes in my Azure region, and `Standard_DS2_v2` should be available. Hereβs a snippet of my Terraform configuration: ```hcl resource "azurerm_network_interface" "example" { name = "my-nic" location = "East US" resource_group_name = azurerm_resource_group.example.name ip_configuration { name = "my-ip-config" subnet_id = azurerm_subnet.example.id private_ip_address_allocation = "Dynamic" } } resource "azurerm_virtual_machine" "example" { name = "my-vm" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name network_interface_ids = [azurerm_network_interface.example.id] vm_size = "Standard_DS2_v2" os_profile { computer_name = "hostname" admin_username = "adminuser" admin_password = "P@ssw0rd" } os_profile_linux_config { disable_password_authentication = false } } ``` I have tried removing the VM and re-creating it, but the configuration remains the same, and I continue to run into the same behavior. Additionally, I made sure to upgrade to the latest version of the Azure provider (v2.80.0), but the scenario continues. I also verified that the resource group and region are correctly specified without any typos. Any insights on what might be causing this behavior or how I can debug this scenario further would be greatly appreciated. I'm working on a web app that needs to handle this. How would you solve this? I'm coming from a different tech stack and learning Hcl. Any pointers in the right direction? My team is using Hcl for this mobile app.