Repository navigation
Terraform Provider #725
Description
Activity
I took a look into how you construct the schemas I imagine the best way to do this would be to create another schema file like one of these but it just outputs the raw data I need, that would ensure that it would be possible to pull all the required data.
Would still appreciate your opinion and if you think making the vlanif field readonly makes sense.
I agree, a new custom schema would be the way to go for providing that extra metadata to clients. That should be relatively easy to implement.
As for the
vlaniffield, at a glance I don't see a reason why this field shouldn't be read-only. Currently, the API will allow the client to specify avlanif, but it will always overwrite that value with its own based on the current parent interface and VLAN tag. A PR is welcome, or you can open a separate issue for that and I can get that in the next patch.As for GraphQL queries, here's an example curl command to execute a query:
curl --request POST https://localhost/api/v2/graphql \ -u 'admin:pfsense' \ -H 'Content-Type: application/json' \ -d '{"query":"query {queryDiagnosticsArpTable(query_params: {ip_address__startswith: \"192.168.4\"}) { id ip_address mac_address }}"}'
Which, for me, provides:
{ "data": { "queryDiagnosticsArpTable": [ { "id": 2, "ip_address": "192.168.4.123", "mac_address": "00:50:56:02:1a:47 <small>(VMware)</small>" } ] } }Let me know if you still have trouble getting queries to work.
Thanks!
- addedenhancementIssues or PRs that enhance existing featuresIssues or PRs that enhance existing features
on Jul 17, 2025 - added a commit that references this issue
on Jul 19, 2025 - linked a pull request that will close this issuev2.6.0 Features & Fixes #747
on Sep 5, 2025
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
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:
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.