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

Allow netbox_custom_field to accept object as type, and specify object_type #593

Closed

Conversation

ad8lmondy
Copy link
Contributor

go-netbox has these additional values defined: https://github.com/fbreckle/go-netbox/blob/2513e68359ff2e42cfc1deed72034bd8ff1dee8e/netbox/models/custom_field.go#L989-L999

But the provider rejects them as invalid.

Tested OK on my personal netbox.

@ad8lmondy ad8lmondy changed the title Allow netbox_custom_field to access more type values defined in go-netbox Allow netbox_custom_field to accept object as type, and specify object_type May 16, 2024
@ad8lmondy
Copy link
Contributor Author

As per the tests, and my own usage - when resources do not have a custom_field set, terraform wants to remove the item:

        Terraform will perform the following actions:
        
          # netbox_prefix.test will be updated in-place
          ~ resource "netbox_prefix" "test" {
              ~ custom_fields = {
                  - "test" = null
                }
                id            = "19"
                # (10 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.

However, this always happens. If I set the resource to have:

custom_fields = {
  test = null
}

Terraform treats the test field as omitted, and so it can never seem to be satisfied.

Not really sure how to get around this issue :(

@ad8lmondy
Copy link
Contributor Author

This is a poor substitute for the work started here: #242

@ad8lmondy ad8lmondy closed this May 30, 2024
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

Successfully merging this pull request may close these issues.

1 participant