-
-
Notifications
You must be signed in to change notification settings - Fork 126
Description
Hi,
I'm currently in the middle of rewriting my terraform provider to work with v2 and I was super excited to see that you are using GraphQL especially since I would really like the terraform provider to be able to generate new resources when they are added to the rest API but I had some problems
- There is some metadata that is not included in the graphql schema but is included in the Model files, would it be possible to generate a json doc with all the model data included? Examples include unique_together, unique, validators, parent model
- Some fields like InterfaceVLAN.vlanif are read only but they are not treated as read only either in the model file or in the graphql schema
- I can't seem to get the query_params in the graphql to work
Would be interesting in hearing your take on these problems. I'm sure I can solve them myself but I don't want to go too far into a solution only to find out later it was wasted time when I could have just asked you.
btw, I am most of the way done with this work, it already generates the terraform schema, the graphql to update, delete, read. The only pieces I'm missing are:
- Knowing how to identify each item (required during the read), I can't use id because that changes as soon as you delete something so I'm hoping to use unique_together or unique to do that.
- Knowing how to find the parent model of a given model so that I can include their uniquely identifying properties in the child resource
- Ensuring properties that are computed like vlanif are tagged as such
These are critical to ensuring that the terraform provider is usable.
Also I want to thank you for making this possible. I mostly just use this for my home network, but it makes it a lot easier to be sure I'm not breaking anything or leaving devices with access they shouldn't have just by looking at my terraform configuration. I can also ensure the same configuration is present in my unifi devices and in my pfsense. I think I would have given up on pfsense were it not for you work.