Terraform #78

Closed
opened 2025-12-29 01:21:45 +01:00 by adam · 8 comments
Owner

Originally created by @kradalby on GitHub (Nov 12, 2021).

Explore the use of our gRPC client to create a terraform provider.

The code can be generated from proto (or imported from the gen directory) and how it can be used can be found in the cli client.

Originally created by @kradalby on GitHub (Nov 12, 2021). Explore the use of our gRPC client to create a terraform provider. The code can be generated from proto (or imported from the gen directory) and how it can be used can be found in the cli client.
adam added the enhancementout of scope labels 2025-12-29 01:21:45 +01:00
adam closed this issue 2025-12-29 01:21:46 +01:00
Author
Owner

@fdelucchijr commented on GitHub (Nov 14, 2021):

this would be an awesome feature!!!

@fdelucchijr commented on GitHub (Nov 14, 2021): this would be an awesome feature!!!
Author
Owner

@samcday commented on GitHub (Oct 15, 2022):

Now that there's an official Tailscale provider plugin published in the registry, that seems to support pointing at a custom base URL, would it perhaps make more sense to try to emulate whatever API calls the provider needs from the official Tailscale control plane?

In that case, the toil of building and maintaining a headscale Terraform provider can be completely avoided. Instead, some documentation would need to be maintained indicating which resources are supported from the official provider, what caveats there are, etc.

In the case of resources that headscale doesn't yet support (which I assume would be a lot of it, at least for now, since ACLs are derived from static filesystem metadata currently and so on), the emulated API layer could simply barf client 4xx errors to signal this unsupported usage.

I'm not sure if there's been discussion in the past about doing something like this (emulating the official/proprietary control plane API), though I wouldn't be surprised if there has and it's fraught with lots of complexities I haven't even begun to consider :D

@samcday commented on GitHub (Oct 15, 2022): Now that there's an official Tailscale provider plugin published [in the registry](https://registry.terraform.io/providers/tailscale/tailscale/latest/docs), that seems to support pointing at a [custom base URL](https://registry.terraform.io/providers/tailscale/tailscale/latest/docs#base_url), would it perhaps make more sense to try to emulate whatever API calls the provider needs from the official Tailscale control plane? In that case, the toil of building and maintaining a headscale Terraform provider can be completely avoided. Instead, some documentation would need to be maintained indicating which resources are supported from the official provider, what caveats there are, etc. In the case of resources that headscale doesn't yet support (which I assume would be a lot of it, at least for now, since ACLs are derived from static filesystem metadata currently and so on), the emulated API layer could simply barf client 4xx errors to signal this unsupported usage. I'm not sure if there's been discussion in the past about doing something like this (emulating the official/proprietary control plane API), though I wouldn't be surprised if there has and it's fraught with lots of complexities I haven't even begun to consider :D
Author
Owner

@unusualevent commented on GitHub (Jan 20, 2023):

I really like the idea of having headscale support the tailscale terraform provider - is there a way to test the coverage between the two interfaces in some kind of unit test?

@unusualevent commented on GitHub (Jan 20, 2023): I really like the idea of having headscale support the tailscale terraform provider - is there a way to test the coverage between the two interfaces in some kind of unit test?
Author
Owner

@kradalby commented on GitHub (Jan 20, 2023):

It is unfeasible, the APIs are not the same.

@kradalby commented on GitHub (Jan 20, 2023): It is unfeasible, the APIs are not the same.
Author
Owner

@awlsring commented on GitHub (Apr 18, 2023):

I wrote a manual provider utilizing the API gen'ed from the swagger doc.

https://registry.terraform.io/providers/awlsring/headscale/latest

If y'all like this, let me know and I can make a PR adding some usage to the docs.

@awlsring commented on GitHub (Apr 18, 2023): I wrote a manual provider utilizing the API gen'ed from the swagger doc. https://registry.terraform.io/providers/awlsring/headscale/latest If y'all like this, let me know and I can make a PR adding some usage to the docs.
Author
Owner

@kradalby commented on GitHub (Apr 19, 2023):

@awlsring, neat, it could also be listed in the readme in the same way as we list UIs atm.

@kradalby commented on GitHub (Apr 19, 2023): @awlsring, neat, it could also be listed in the readme in the same way as we list UIs atm.
Author
Owner

@awlsring commented on GitHub (Apr 27, 2023):

@kradalby Sure thing.

Looking at the readme, I was thinking of just renaming the section Graphical Control Panels to Control Planes and listing as a box in there.

I'll try to send out a PR for it in a few days

@awlsring commented on GitHub (Apr 27, 2023): @kradalby Sure thing. Looking at the readme, I was thinking of just renaming the section `Graphical Control Panels` to `Control Planes` and listing as a box in there. I'll try to send out a PR for it in a few days
Author
Owner

@kradalby commented on GitHub (May 10, 2023):

I will close this as out of scope, we happy with a community provider

@kradalby commented on GitHub (May 10, 2023): I will close this as out of scope, we happy with a community provider
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#78