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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant tags are inaccessible #645

Open
sempervictus opened this issue Oct 11, 2024 · 0 comments
Open

Tenant tags are inaccessible #645

sempervictus opened this issue Oct 11, 2024 · 0 comments

Comments

@sempervictus
Copy link

sempervictus commented Oct 11, 2024

Terraform Version

OpenTofu v1.8.2
on linux_amd64
+ provider registry.opentofu.org/e-breuninger/netbox v3.9.2

Affected Resource(s)

Please list the resources as a list, for example:

  • data_source.netbox_tenants
  • data_source.netbox_tenant
  • resource.netbox_tenant

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

Terraform Configuration Files

import {
  for_each = {for k, v in local.nb_cluster_map: v.tid => v.tenant...}
  id = each.key
  to = netbox_tenant.testing[each.value[0]]
}
resource "netbox_tenant" "testing" {
  for_each = toset(distinct([for k, v in local.nb_cluster_map: v.tenant]))
  name = each.value
  lifecycle {
    ignore_changes = [ group_id ]
  }
}
output "netbox_tenant-testing" {
  value = netbox_tenant.testing
}

Expected Behavior

The tags element of netbox_tenant.testing should be populated.
The data sources for tenant or tenants should have tags schema elements

Actual Behavior

  + netbox_tenant-testing = {
      + testing-cluster1 = {
          + description = ""
          + group_id    = 5
          + id          = "1"
          + name        = "testing-cluster1"
          + slug        = "testing-cluster1"
          + tags        = null
        }
    }

whereas the data sources simply lack relevant schema elements.
Tags applied to devices however do show up when imported this way.

Steps to Reproduce

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

No branches or pull requests

1 participant