e-breuninger/terraform-provider-netbox

Provider produced inconsistent final plan for netbox_interface

Korney95 opened this issue · 0 comments

Terraform Version

Terraform v1.7.3
on darwin_amd64
+ provider registry.terraform.io/e-breuninger/netbox v3.8.7
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/rework-space-com/freeipa v3.0.0
+ provider registry.terraform.io/telmate/proxmox v3.0.1-rc3

Your version of Terraform is out of date! The latest version
is 1.9.2. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Please list the resources as a list, for example:

  • netbox_interface

If this issue appears to affect multiple resources, it may be an issue with
Terraform's core, so please mention this.

Terraform Configuration Files

resource "netbox_interface" "new_interface" {
  count = length(proxmox_vm_qemu.vm_proxmox.network)
  name = "${proxmox_vm_qemu.vm_proxmox.network[count.index].model}${count.index}"
  mac_address = proxmox_vm_qemu.vm_proxmox.network[count.index].macaddr
  virtual_machine_id = netbox_virtual_machine.new_machine.id
}

Actual Behavior

Terraform will perform the following actions:

  # module.my.netbox_interface.new_interface[0] will be updated in-place
  ~ resource "netbox_interface" "new_interface" {
        id                 = "2171"
      + mac_address        = "16:9A:F8:1C:06:C8"
        name               = "virtio0"
        tags               = []
        # (4 unchanged attributes hidden)
    }

  # module.my.netbox_interface.new_interface[1] will be created
  + resource "netbox_interface" "new_interface" {
      + enabled            = true
      + id                 = (known after apply)
      + name               = "virtio1"
      + virtual_machine_id = 2219
    }

  # module.my.netbox_ip_address.new_ip_address[1] will be created
  + resource "netbox_ip_address" "new_ip_address" {
      + dns_name              = "test.local"
      + id                    = (known after apply)
      + interface_id          = (known after apply)
      + ip_address            = "10.10.10.122/32"
      + nat_outside_addresses = (known after apply)
      + object_type           = "virtualization.vminterface"
      + status                = "active"
    }


Plan: 2 to add, 2 to change, 0 to destroy.

When I confirm these changes, terraform fails to execute any changes and returns an error.

│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for module.my.netbox_interface.new_interface[1] to include new values learned so far during apply, provider "registry.terraform.io/e-breuninger/netbox" produced an invalid new
│ value for .mac_address: was null, but now cty.StringVal("42:FB:6D:00:B0:0E").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply