mirror of
https://github.com/netbirdio/terraform-provider-netbird.git
synced 2026-05-22 17:13:16 -07:00
update custom zones data sources and resources docs
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
page_title: "netbird_dns_record Data Source - netbird"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Read DNS Record information.
|
||||
Read DNS Record metadata, see NetBird Docs https://docs.netbird.io/manage/dns/custom-zones for more information.
|
||||
---
|
||||
|
||||
# netbird_dns_record (Data Source)
|
||||
|
||||
Read DNS Record information.
|
||||
Read DNS Record metadata, see [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.
|
||||
|
||||
## Example Usage
|
||||
|
||||
@@ -16,18 +16,18 @@ Read DNS Record information.
|
||||
# Query by ID
|
||||
data "netbird_dns_record" "by_id" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
id = "record-id-here"
|
||||
id = "d50moeqtvgfc7398k38g"
|
||||
}
|
||||
|
||||
# Query by name and type
|
||||
data "netbird_dns_record" "www" {
|
||||
data "netbird_dns_record" "by_name_and_type" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "www.example.local"
|
||||
type = "A"
|
||||
}
|
||||
|
||||
# Query by name only
|
||||
data "netbird_dns_record" "api" {
|
||||
data "netbird_dns_record" "by_name" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "api.example.local"
|
||||
}
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
page_title: "netbird_dns_zone Data Source - netbird"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Read DNS Zone information.
|
||||
Read DNS Zone metadata, see NetBird Docs https://docs.netbird.io/manage/dns/custom-zones for more information.
|
||||
---
|
||||
|
||||
# netbird_dns_zone (Data Source)
|
||||
|
||||
Read DNS Zone information.
|
||||
Read DNS Zone metadata, see [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "netbird_dns_zone" "example" {
|
||||
name = "example-zone"
|
||||
data "netbird_dns_zone" "by_name" {
|
||||
name = "example.local"
|
||||
}
|
||||
|
||||
# Query by ID
|
||||
data "netbird_dns_zone" "by_id" {
|
||||
id = "zone-id-here"
|
||||
id = "d50ltp59q2cs73ea7ss0"
|
||||
}
|
||||
|
||||
# Query by domain
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
page_title: "netbird_dns_record Resource - netbird"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Create and manage DNS records within DNS zones. See NetBird Docs https://docs.netbird.io/how-to/manage-dns-in-your-network for more information.
|
||||
Create and manage DNS records within DNS zones. See NetBird Docs https://docs.netbird.io/manage/dns/custom-zones for more information.
|
||||
---
|
||||
|
||||
# netbird_dns_record (Resource)
|
||||
|
||||
Create and manage DNS records within DNS zones. See [NetBird Docs](https://docs.netbird.io/how-to/manage-dns-in-your-network) for more information.
|
||||
Create and manage DNS records within DNS zones. See [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.
|
||||
|
||||
## Example Usage
|
||||
|
||||
@@ -37,7 +37,16 @@ resource "netbird_dns_record" "mail" {
|
||||
name = "mail.example.local"
|
||||
type = "CNAME"
|
||||
content = "mail.external.com"
|
||||
ttl = 3600
|
||||
ttl = 300
|
||||
}
|
||||
|
||||
# Wildcard Record example
|
||||
resource "netbird_dns_record" "wildcard" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "*.example.local"
|
||||
type = "A"
|
||||
content = "10.10.1.2"
|
||||
ttl = 300
|
||||
}
|
||||
```
|
||||
|
||||
@@ -58,3 +67,15 @@ resource "netbird_dns_record" "mail" {
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) DNS Record ID
|
||||
|
||||
## Import
|
||||
|
||||
Import is supported using the following syntax:
|
||||
|
||||
```shell
|
||||
terraform import netbird_dns_zone.example dns_zone_id
|
||||
|
||||
# For example
|
||||
|
||||
terraform import netbird_dns_zone.example d50lthitvgfc7398k370
|
||||
```
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
page_title: "netbird_dns_zone Resource - netbird"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Create and manage custom DNS zones. See NetBird Docs https://docs.netbird.io/how-to/manage-dns-in-your-network for more information.
|
||||
Create and manage custom DNS zones. See NetBird Docs https://docs.netbird.io/manage/dns/custom-zones for more information.
|
||||
---
|
||||
|
||||
# netbird_dns_zone (Resource)
|
||||
|
||||
Create and manage custom DNS zones. See [NetBird Docs](https://docs.netbird.io/how-to/manage-dns-in-your-network) for more information.
|
||||
Create and manage custom DNS zones. See [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.
|
||||
|
||||
## Example Usage
|
||||
|
||||
@@ -18,7 +18,7 @@ resource "netbird_dns_zone" "internal" {
|
||||
domain = "internal.company.com"
|
||||
enabled = true
|
||||
enable_search_domain = true
|
||||
distribution_groups = [netbird_group.dev.id, netbird_group.ops.id]
|
||||
distribution_groups = [netbird_group.example.id]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -39,3 +39,15 @@ resource "netbird_dns_zone" "internal" {
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) DNS Zone ID
|
||||
|
||||
## Import
|
||||
|
||||
Import is supported using the following syntax:
|
||||
|
||||
```shell
|
||||
terraform import netbird_group.example group_id
|
||||
|
||||
# For example
|
||||
|
||||
terraform import netbird_group.example cvi609bl0ubs73ask10g
|
||||
```
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Query by ID
|
||||
data "netbird_dns_record" "by_id" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
id = "record-id-here"
|
||||
id = "d50moeqtvgfc7398k38g"
|
||||
}
|
||||
|
||||
# Query by name and type
|
||||
data "netbird_dns_record" "www" {
|
||||
data "netbird_dns_record" "by_name_and_type" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "www.example.local"
|
||||
type = "A"
|
||||
}
|
||||
|
||||
# Query by name only
|
||||
data "netbird_dns_record" "api" {
|
||||
data "netbird_dns_record" "by_name" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "api.example.local"
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
data "netbird_dns_zone" "example" {
|
||||
name = "example-zone"
|
||||
data "netbird_dns_zone" "by_name" {
|
||||
name = "example.local"
|
||||
}
|
||||
|
||||
# Query by ID
|
||||
data "netbird_dns_zone" "by_id" {
|
||||
id = "zone-id-here"
|
||||
id = "d50ltp59q2cs73ea7ss0"
|
||||
}
|
||||
|
||||
# Query by domain
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
terraform import netbird_dns_zone.example dns_zone_id
|
||||
|
||||
# For example
|
||||
|
||||
terraform import netbird_dns_zone.example d50lthitvgfc7398k370
|
||||
@@ -22,5 +22,14 @@ resource "netbird_dns_record" "mail" {
|
||||
name = "mail.example.local"
|
||||
type = "CNAME"
|
||||
content = "mail.external.com"
|
||||
ttl = 3600
|
||||
ttl = 300
|
||||
}
|
||||
|
||||
# Wildcard Record example
|
||||
resource "netbird_dns_record" "wildcard" {
|
||||
zone_id = netbird_dns_zone.example.id
|
||||
name = "*.example.local"
|
||||
type = "A"
|
||||
content = "10.10.1.2"
|
||||
ttl = 300
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
terraform import netbird_group.example group_id
|
||||
|
||||
# For example
|
||||
|
||||
terraform import netbird_group.example cvi609bl0ubs73ask10g
|
||||
@@ -3,5 +3,5 @@ resource "netbird_dns_zone" "internal" {
|
||||
domain = "internal.company.com"
|
||||
enabled = true
|
||||
enable_search_domain = true
|
||||
distribution_groups = [netbird_group.dev.id, netbird_group.ops.id]
|
||||
distribution_groups = [netbird_group.example.id]
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
|
||||
netbird "github.com/netbirdio/netbird/shared/management/client/rest"
|
||||
"github.com/netbirdio/netbird/shared/management/http/api"
|
||||
)
|
||||
@@ -31,7 +32,8 @@ func (d *DNSRecordDataSource) Metadata(ctx context.Context, req datasource.Metad
|
||||
|
||||
func (d *DNSRecordDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
MarkdownDescription: "Read DNS Record information.",
|
||||
Description: "Read DNS Record metadata.",
|
||||
MarkdownDescription: "Read DNS Record metadata, see [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
MarkdownDescription: "DNS Record ID",
|
||||
|
||||
@@ -55,7 +55,7 @@ func (r *DNSRecord) Metadata(ctx context.Context, req resource.MetadataRequest,
|
||||
func (r *DNSRecord) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Create and manage DNS records within DNS zones",
|
||||
MarkdownDescription: "Create and manage DNS records within DNS zones. See [NetBird Docs](https://docs.netbird.io/how-to/manage-dns-in-your-network) for more information.",
|
||||
MarkdownDescription: "Create and manage DNS records within DNS zones. See [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.",
|
||||
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
|
||||
netbird "github.com/netbirdio/netbird/shared/management/client/rest"
|
||||
"github.com/netbirdio/netbird/shared/management/http/api"
|
||||
)
|
||||
@@ -32,7 +33,8 @@ func (d *DNSZoneDataSource) Metadata(ctx context.Context, req datasource.Metadat
|
||||
|
||||
func (d *DNSZoneDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
MarkdownDescription: "Read DNS Zone information.",
|
||||
Description: "Read DNS Zone metadata.",
|
||||
MarkdownDescription: "Read DNS Zone metadata, see [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
MarkdownDescription: "DNS Zone ID",
|
||||
|
||||
@@ -55,7 +55,7 @@ func (r *DNSZone) Metadata(ctx context.Context, req resource.MetadataRequest, re
|
||||
func (r *DNSZone) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Description: "Create and manage custom DNS zones",
|
||||
MarkdownDescription: "Create and manage custom DNS zones. See [NetBird Docs](https://docs.netbird.io/how-to/manage-dns-in-your-network) for more information.",
|
||||
MarkdownDescription: "Create and manage custom DNS zones. See [NetBird Docs](https://docs.netbird.io/manage/dns/custom-zones) for more information.",
|
||||
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
|
||||
Reference in New Issue
Block a user