netbird-terraform

Manages NetBird networks, policies, and peers declaratively via the Terraform provider.

4|2|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/Aidas-dev/k8s-agent-skills --skill netbird-terraform-aidas-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: netbird-terraform
Source: https://github.com/Aidas-dev/k8s-agent-skills/tree/main/skills/netbird-terraform
Command: npx skills add https://github.com/Aidas-dev/k8s-agent-skills --skill netbird-terraform-aidas-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing NetBird mesh VPN resources (groups, routes, policies, DNS, setup keys) by hand through the UI is error-prone and hard to reproduce. This Skill provides complete reference knowledge for the netbirdio/netbird Terraform provider so you can manage NetBird infrastructure as code through the public Management API. ## Core Features & Use Cases - Full Resource Coverage: Documents all 20 resources and 22 data sources, including groups, peers, routes, networks, policies, setup keys, DNS zones/records, posture checks, users, tokens, SCIM, identity providers, and reverse proxy services. - Ready-to-Use Patterns: Provides HCL examples for provider setup, access policies, network/resource/router topologies, legacy routes and exit nodes, netbird-ssh policies, setup keys, and posture checks. - Pitfall Guidance: Covers import commands and common mistakes such as setup key data source limitations, peer creation semantics, dns_settings uniqueness, and mutually exclusive route fields. - Use Case: You want to codify your NetBird environment — create a network with resources and routers, attach groups, and enforce an SSH access policy — all in a single Terraform plan. ## Quick Start Ask the agent to write Terraform configuration that creates a NetBird network with a resource, a routing peer group, and an access policy using the netbirdio/netbird provider.

Frequently Asked Questions about netbird-terraform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage NetBird with Terraform?▼

Use the netbirdio/netbird Terraform provider with a Management API personal access token passed via the token argument or NB_PAT environment variable. The provider exposes 20 resources and 22 data sources covering groups, routes, policies, DNS, and more.

How to create a NetBird access policy in Terraform?▼

Define a netbird_policy resource with one or more rule blocks specifying action, protocol, sources, and destinations referencing netbird_group IDs. For SSH access, use the dedicated netbird-ssh protocol with authorized_groups rather than tcp port 22.

Can the netbird_peer resource create new peers?▼

No, netbird_peer only manages an existing peer looked up by ID or IP, such as setting name, ssh_enabled, approval, or expiry. Peers appear when clients register, so use netbird_setup_key resources to automate enrollment.

Why can't the netbird_setup_key data source read the key value?▼

The setup key data source only exposes metadata, not the plain key value, by design of the Management API. Use the resource output at creation time for provisioning, or retrieve the key from the management UI.

How do I import existing NetBird resources into Terraform?▼

Run terraform import with the resource address and ID, for example terraform import netbird_group.example <group_id>. Network resources use the composite form <network_id>/<resource_id>, and existing users must be imported because netbird_user create only sends invitations.

What are the limitations of NetBird route resources in Terraform?▼

The network (CIDR) and domains fields are mutually exclusive, as are peer and peer_groups, so pick one per route. Domains support up to 32 entries with dynamic resolution, and lower metric values give higher route priority.