Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_virtual_machine: some properties keep being reported as changed after import #25734

Open
1 task done
cveld opened this issue Apr 24, 2024 · 1 comment
Open
1 task done

Comments

@cveld
Copy link

cveld commented Apr 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.8.1

AzureRM Provider Version

3.100.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_machine

Terraform Configuration Files

resource "azurerm_virtual_machine" "elk" {
  location              = module.rg.groups.elk.location
  name                  = var.config.vm.elk.name
  resource_group_name   = module.rg.groups.elk.name
  network_interface_ids = [azurerm_network_interface.default.id]
  storage_os_disk {
    name              = var.config.vm.elk.os_disk_name
    caching           = "ReadWrite"
    create_option     = "Attach"
    managed_disk_type = "Premium_LRS"
  }
  vm_size = "Standard_E4as_v5"
}

Debug Output/Panic Output

N/A

Expected Behaviour

No changes being reported. Although additional_capabilities and os_profile_linux_config can be worked around by adding these to my config, I am not sure how to work around os_profile.

Actual Behaviour

Terraform plan reports the following unexpected changes:

# module.Infrastructure.azurerm_virtual_machine.elk will be updated in-place
  ~ resource "azurerm_virtual_machine" "elk" {
        id                               = "/subscriptions/redacted/resourceGroups/rg-elk-dev/providers/Microsoft.Compute/virtualMachines/vm-elk-dev-trbd"
        name                             = "vm-elk-dev-trbd"
        tags                             = {}
        # (7 unchanged attributes hidden)

      - additional_capabilities {}

      - os_profile {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }

      - os_profile_linux_config {
          - disable_password_authentication = false -> null
        }

        # (4 unchanged blocks hidden)
    }

Steps to Reproduce

  1. create a vm through clickops
  2. import it into terraform
  3. run apply

Important Factoids

No response

References

No response

@cveld
Copy link
Author

cveld commented Apr 27, 2024

@rcskosir I got triggered by the tag added to ask this side question; do you know why azurerm_virtual_machine has been marked deprecated whereas not all features have been ported yet to its successors azurerm_linux_virtual_machine and azurerm_windows_virtual_machine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants