[GH-ISSUE #1208] terraform provider for netbird REST API #1885

Closed
opened 2026-08-05 00:44:24 -04:00 by saavagebueno · 22 comments
Owner

Originally created by @theblop on GitHub (Oct 10, 2023).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/1208

Is your feature request related to a problem? Please describe.
It would be great to be able to manage netbird server with terraform (a lot of people already use terraform to manage their infrastructure)

Describe the solution you'd like
a terraform provider to interact with the netbird REST API

Originally created by @theblop on GitHub (Oct 10, 2023). Original GitHub issue: https://github.com/netbirdio/netbird/issues/1208 **Is your feature request related to a problem? Please describe.** It would be great to be able to manage netbird server with terraform (a lot of people already use terraform to manage their infrastructure) **Describe the solution you'd like** a terraform provider to interact with the netbird REST API
saavagebueno added the feature-requestintegrationautomation labels 2026-08-05 00:44:24 -04:00
Author
Owner

@mlsmaycon commented on GitHub (Oct 11, 2023):

Hello @theblop, thanks for the request. We are looking at a terraform provider initial version for this quarter. We will keep this updated as we progress with it.

<!-- gh-comment-id:1757179725 --> @mlsmaycon commented on GitHub (Oct 11, 2023): Hello @theblop, thanks for the request. We are looking at a terraform provider initial version for this quarter. We will keep this updated as we progress with it.
Author
Owner

@mkoyan44 commented on GitHub (Dec 14, 2023):

@mlsmaycon
Hey, do you have any updates on the topic? Which resources are you going to support?

<!-- gh-comment-id:1856809557 --> @mkoyan44 commented on GitHub (Dec 14, 2023): @mlsmaycon Hey, do you have any updates on the topic? Which resources are you going to support?
Author
Owner

@RocketRene commented on GitHub (Jan 27, 2024):

I am also curious

<!-- gh-comment-id:1913444253 --> @RocketRene commented on GitHub (Jan 27, 2024): I am also curious
Author
Owner

@ednxzu commented on GitHub (May 4, 2024):

Any update on this ? Would be super convenient !

<!-- gh-comment-id:2094086585 --> @ednxzu commented on GitHub (May 4, 2024): Any update on this ? Would be super convenient !
Author
Owner

@RocketRene commented on GitHub (May 16, 2024):

Is this maintained by netbird ?

https://github.com/speakeasy-sdks/terraform-provider-netbird

<!-- gh-comment-id:2115193488 --> @RocketRene commented on GitHub (May 16, 2024): Is this maintained by netbird ? https://github.com/speakeasy-sdks/terraform-provider-netbird
Author
Owner

@boopzz commented on GitHub (Aug 21, 2024):

looks like speakeasy make terraform providers for projects so it looks like the start, hopefully theres a private branch just about to be committed! 🙏

<!-- gh-comment-id:2302499325 --> @boopzz commented on GitHub (Aug 21, 2024): looks like speakeasy make terraform providers for projects so it looks like the start, hopefully theres a private branch just about to be committed! 🙏
Author
Owner

@tafaust commented on GitHub (Sep 16, 2024):

Is it safe (and legal) to use that codebase as a foundation @speakeasy-sdks / @TristanSpeakEasy?

<!-- gh-comment-id:2352306757 --> @tafaust commented on GitHub (Sep 16, 2024): Is it safe (and legal) to use that codebase as a foundation @speakeasy-sdks / @TristanSpeakEasy?
Author
Owner

@mlsmaycon commented on GitHub (Sep 16, 2024):

We have a community member working on a provider. We are using the Hashicorp OpenAPI Provider Spec Generator for the foundation.

We should have an initial version of the provider earlier in Q4 this year.

<!-- gh-comment-id:2352549462 --> @mlsmaycon commented on GitHub (Sep 16, 2024): We have a community member working on a provider. We are using the Hashicorp OpenAPI Provider Spec Generator for the foundation. We should have an initial version of the provider earlier in Q4 this year.
Author
Owner

@simplesagar commented on GitHub (Sep 16, 2024):

Hey @tafaust that repository is meant to be an example of our generation capabilities at https://github.com/speakeasy-api and may not be up to date with the latest Netbird API. Its actually empty and doesn't have any tf resources defined yet

@mlsmaycon would be happy to help you all generate and maintain a really nice terraform provider. Here are a few we maintain in real time.

Here's a walk through of our generation as well as Hashicorp's method. I'm one of co founders of Speakeasy and would love to help if we can !

<!-- gh-comment-id:2353729340 --> @simplesagar commented on GitHub (Sep 16, 2024): Hey @tafaust that repository is meant to be an example of our generation capabilities at https://github.com/speakeasy-api and may not be up to date with the latest Netbird API. Its actually empty and doesn't have any tf resources defined yet @mlsmaycon would be happy to help you all generate and maintain a really nice terraform provider. Here are a few we maintain in real time. - https://github.com/opalsecurity/terraform-provider-opal - https://github.com/StyraInc/terraform-provider-styra - https://github.com/teamlumos/terraform-provider-lumos - https://github.com/Kong/terraform-provider-konnect Here's a [walk through](https://www.speakeasy.com/post/how-to-build-terraform-providers) of our generation as well as Hashicorp's method. I'm one of co founders of Speakeasy and would love to help if we can !
Author
Owner

@ProGaraK commented on GitHub (Nov 20, 2024):

We have a community member working on a provider. We are using the Hashicorp OpenAPI Provider Spec Generator for the foundation.

We should have an initial version of the provider earlier in Q4 this year.

Any update on this?

<!-- gh-comment-id:2488513535 --> @ProGaraK commented on GitHub (Nov 20, 2024): > We have a community member working on a provider. We are using the Hashicorp OpenAPI Provider Spec Generator for the foundation. > > We should have an initial version of the provider earlier in Q4 this year. Any update on this?
Author
Owner

@marcportabellaclotet-mt commented on GitHub (Dec 21, 2024):

Using Speakeasy makes it incredibly simple to create a Terraform provider for Netbird. After some testing, I was able to build a functional provider. However, there are two aspects of the Netbird API that might need addressing:

  1. Route Creation: Currently, the Netbird API allows defining either a network or a domain when creating a route. However, if an empty network value is provided while specifying a domain, the API returns an error, as only one of the two is allowed. Could this behavior be adjusted to accept an empty network value when a domain is defined? This change would simplify Terraform provider development, though it is possible to implement a workaround.

  2. Setup Key Values: When setup keys are created, their values are returned in plain text. However, subsequent API responses for these keys provide only obfuscated values. This causes the Terraform provider to retrieve only the obfuscated version, which can also be worked around but adds complexity.

According to Speakeasy's documentation, their service might be free for open-source projects. Would the Netbird team be interested in exploring this option?

(Text reference: [Speakeasy Pricing](https://www.speakeasy.com/pricing))

If you're working on a 'free as in speech' OSS project, you can use Speakeasy for free. Just fill out this TypeForm: https://speakeasyapi.typeform.com/oss-program
<!-- gh-comment-id:2558244488 --> @marcportabellaclotet-mt commented on GitHub (Dec 21, 2024): Using Speakeasy makes it incredibly simple to create a Terraform provider for Netbird. After some testing, I was able to build a functional provider. However, there are two aspects of the Netbird API that might need addressing: 1. **Route Creation**: Currently, the Netbird API allows defining either a network or a domain when creating a route. However, if an empty network value is provided while specifying a domain, the API returns an error, as only one of the two is allowed. Could this behavior be adjusted to accept an empty network value when a domain is defined? This change would simplify Terraform provider development, though it is possible to implement a workaround. 2. **Setup Key Values**: When setup keys are created, their values are returned in plain text. However, subsequent API responses for these keys provide only obfuscated values. This causes the Terraform provider to retrieve only the obfuscated version, which can also be worked around but adds complexity. According to Speakeasy's documentation, their service might be free for open-source projects. Would the Netbird team be interested in exploring this option? (Text reference: [[Speakeasy Pricing](https://www.speakeasy.com/pricing)](https://www.speakeasy.com/pricing)) ``` If you're working on a 'free as in speech' OSS project, you can use Speakeasy for free. Just fill out this TypeForm: https://speakeasyapi.typeform.com/oss-program ```
Author
Owner

@ayprof commented on GitHub (Feb 6, 2025):

Any news?

<!-- gh-comment-id:2638846109 --> @ayprof commented on GitHub (Feb 6, 2025): Any news?
Author
Owner

@tafaust commented on GitHub (Feb 9, 2025):

@mlsmaycon for reference. Maybe Speakeasy is the way to go here? I guess the terraform provider will not be monetised anyways?

<!-- gh-comment-id:2646373690 --> @tafaust commented on GitHub (Feb 9, 2025): @mlsmaycon for reference. Maybe Speakeasy is the way to go here? I guess the terraform provider will not be monetised anyways?
Author
Owner

@sebastienbaillet commented on GitHub (Apr 7, 2025):

Any news ?

<!-- gh-comment-id:2782553892 --> @sebastienbaillet commented on GitHub (Apr 7, 2025): Any news ?
Author
Owner

@nazarewk commented on GitHub (Apr 7, 2025):

We're still trying to organize an official provider, but we don't have an ETA. Personally, I currently have more than enough responsibilities during work hours and cannot dedicate overtime to it.

Meanwhile, here is a non-exhaustive list of community efforts:

<!-- gh-comment-id:2783573165 --> @nazarewk commented on GitHub (Apr 7, 2025): We're still trying to organize an official provider, but we don't have an ETA. Personally, I currently have more than enough responsibilities during work hours and cannot dedicate overtime to it. Meanwhile, here is a non-exhaustive list of community efforts: - [recent Slack thread](https://netbirdio.slack.com/archives/C05T5K65X7U/p1743086753289469) - https://registry.terraform.io/providers/DockStudios/netbird/latest - https://github.com/mojaloop/terraform-provider-netbird
Author
Owner

@praneetloke commented on GitHub (Feb 7, 2026):

I have a kind of a related question. I am looking into generating a Pulumi provider from your OpenAPI specs but I couldn't the OpenAPI spec in this repo. Your docs website don't mention anything either.

<!-- gh-comment-id:3863715210 --> @praneetloke commented on GitHub (Feb 7, 2026): I have a kind of a related question. I am looking into generating a Pulumi provider from your OpenAPI specs but I couldn't the OpenAPI spec in this repo. Your docs website don't mention anything either.
Author
Owner

@mlsmaycon commented on GitHub (Feb 7, 2026):

Hey folks, regarding Terraform we have a provider for some time, and somehow, didn't close this issue:

https://github.com/netbirdio/terraform-provider-netbird
https://registry.terraform.io/providers/netbirdio/netbird/latest/docs

@praneetloke it uses our REST client:

https://github.com/netbirdio/netbird/tree/main/shared/management/client/rest

We are also updating it:
https://github.com/netbirdio/netbird/pull/5222

@praneetloke, I will close this one as completed, but we can discuss the Pulumi provider in another issue if you want. That interests us very much.

<!-- gh-comment-id:3863855276 --> @mlsmaycon commented on GitHub (Feb 7, 2026): Hey folks, regarding Terraform we have a provider for some time, and somehow, didn't close this issue: https://github.com/netbirdio/terraform-provider-netbird https://registry.terraform.io/providers/netbirdio/netbird/latest/docs @praneetloke it uses our REST client: https://github.com/netbirdio/netbird/tree/main/shared/management/client/rest We are also updating it: https://github.com/netbirdio/netbird/pull/5222 @praneetloke, I will close this one as completed, but we can discuss the Pulumi provider in another issue if you want. That interests us very much.
Author
Owner

@praneetloke commented on GitHub (Feb 7, 2026):

@mlsmaycon thank you! I've subscribed to that PR. Out of curiosity, do you use a generator for the OpenAPI spec? I do see couple of issues in the API spec that is in #5222. I'll wait for it to be merged and check again.

<!-- gh-comment-id:3865083512 --> @praneetloke commented on GitHub (Feb 7, 2026): @mlsmaycon thank you! I've subscribed to that PR. Out of curiosity, do you use a generator for the OpenAPI spec? I do see couple of issues in the API spec that is in #5222. I'll wait for it to be merged and check again.
Author
Owner

@mlsmaycon commented on GitHub (Feb 8, 2026):

@praneetloke the generators are next to the spec: https://github.com/netbirdio/netbird/blob/main/shared/management/http/api/generate.sh

<!-- gh-comment-id:3868632436 --> @mlsmaycon commented on GitHub (Feb 8, 2026): @praneetloke the generators are next to the spec: https://github.com/netbirdio/netbird/blob/main/shared/management/http/api/generate.sh
Author
Owner

@praneetloke commented on GitHub (Feb 8, 2026):

Got it. Thank you. I was specifically interested in how the OpenAPI spec, i.e. openapi.yml, was maintained. Do you use any tools to generate/validate that spec doc?

<!-- gh-comment-id:3868779902 --> @praneetloke commented on GitHub (Feb 8, 2026): Got it. Thank you. I was specifically interested in how the OpenAPI spec, i.e. [`openapi.yml`](https://github.com/netbirdio/netbird/blob/main/shared/management/http/api/openapi.yml), was maintained. Do you use any tools to generate/validate that spec doc?
Author
Owner

@mlsmaycon commented on GitHub (Feb 8, 2026):

Not really. We usually create the endpoint spec manually and generate the API types out of it.

<!-- gh-comment-id:3868794066 --> @mlsmaycon commented on GitHub (Feb 8, 2026): Not really. We usually create the endpoint spec manually and generate the API types out of it.
Author
Owner

@praneetloke commented on GitHub (Feb 8, 2026):

I'll open a new issue with some observations. Thank you for your responses, @mlsmaycon!

<!-- gh-comment-id:3868867133 --> @praneetloke commented on GitHub (Feb 8, 2026): I'll open a new issue with some observations. Thank you for your responses, @mlsmaycon!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#1885