Skip to content

Commit

Permalink
docs: improve DNS config and access list attribute documentation (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichels authored Apr 6, 2023
1 parent ce7745b commit 8216c0a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions adguard/dns_access_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func (r *dnsAccessResource) Schema(_ context.Context, _ resource.SchemaRequest,
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Internal identifier for this dnsAccess",
Description: "Internal identifier of the DNS access list",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"last_updated": schema.StringAttribute{
Description: "Timestamp of the last Terraform update of the dnsAccess",
Description: "Timestamp of the last Terraform update of the DNS access list",
Computed: true,
},
"allowed_clients": schema.ListAttribute{
Expand Down Expand Up @@ -220,7 +220,7 @@ func (r *dnsAccessResource) Read(ctx context.Context, req resource.ReadRequest,
return
}

// get refreshed DNS Access List value from AdGuard Home
// get refreshed DNS Access List from AdGuard Home
dnsAccess, err := r.adg.GetAccess()
if err != nil {
resp.Diagnostics.AddError(
Expand Down
16 changes: 8 additions & 8 deletions adguard/dns_config_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ func (r *dnsConfigResource) Schema(_ context.Context, _ resource.SchemaRequest,
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Internal identifier for this dnsConfig",
Description: "Internal identifier for this DNS config",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"last_updated": schema.StringAttribute{
Description: "Timestamp of the last Terraform update of the dnsConfig",
Description: "Timestamp of the last Terraform update of the DNS config",
Computed: true,
},
"bootstrap_dns": schema.ListAttribute{
Expand Down Expand Up @@ -122,7 +122,7 @@ func (r *dnsConfigResource) Schema(_ context.Context, _ resource.SchemaRequest,
Default: int64default.StaticInt64(20),
},
"blocking_mode": schema.StringAttribute{
Description: "DNS response sent when request is blocked",
Description: "DNS response sent when request is blocked. Valid values are `default`, `refused`, `nxdomain`, `null_ip` or `custom_ip`",
Optional: true,
Computed: true,
Default: stringdefault.StaticString("default"),
Expand Down Expand Up @@ -193,13 +193,13 @@ func (r *dnsConfigResource) Schema(_ context.Context, _ resource.SchemaRequest,
Default: int64default.StaticInt64(4194304),
},
"cache_ttl_min": schema.Int64Attribute{
Description: "Overridden minimum TTL received from upstream DNS servers",
Description: "Overridden minimum TTL (in seconds) received from upstream DNS servers",
Optional: true,
Computed: true,
Default: int64default.StaticInt64(0),
},
"cache_ttl_max": schema.Int64Attribute{
Description: "Overridden maximum TTL received from upstream DNS servers",
Description: "Overridden maximum TTL (in seconds) received from upstream DNS servers",
Optional: true,
Computed: true,
Default: int64default.StaticInt64(0),
Expand All @@ -211,7 +211,7 @@ func (r *dnsConfigResource) Schema(_ context.Context, _ resource.SchemaRequest,
Default: booldefault.StaticBool(false),
},
"upstream_mode": schema.StringAttribute{
Description: "Upstream DNS resolvers usage strategy",
Description: "Upstream DNS resolvers usage strategy. Valid values are `load_balance` (default), `parallel` and `fastest_addr`",
Optional: true,
Computed: true,
Default: stringdefault.StaticString("load_balance"),
Expand Down Expand Up @@ -339,7 +339,7 @@ func (r *dnsConfigResource) Read(ctx context.Context, req resource.ReadRequest,
return
}

// get refreshed DNS dnsConfig rule value from AdGuard Home
// get refreshed DNS Config value from AdGuard Home
dnsConfig, err := r.adg.GetDnsInfo()
if err != nil {
resp.Diagnostics.AddError(
Expand All @@ -349,7 +349,7 @@ func (r *dnsConfigResource) Read(ctx context.Context, req resource.ReadRequest,
return
}

// overwrite DNS dnsConfig rule with refreshed state
// overwrite DNS Config with refreshed state
state.BootstrapDns, diags = types.ListValueFrom(ctx, types.StringType, dnsConfig.BootstrapDns)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/dns_access.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ resource "adguard_dns_access" "test" {

### Read-Only

- `id` (String) Internal identifier for this dnsAccess
- `last_updated` (String) Timestamp of the last Terraform update of the dnsAccess
- `id` (String) Internal identifier of the DNS access list
- `last_updated` (String) Timestamp of the last Terraform update of the DNS access list

## Import

Expand Down
12 changes: 6 additions & 6 deletions docs/resources/dns_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ resource "adguard_dns_config" "test" {

- `blocking_ipv4` (String) When `blocking_mode` is set to `custom_ip`, the IPv4 address to be returned for a blocked A request
- `blocking_ipv6` (String) When `blocking_mode` is set to `custom_ip`, the IPv6 address to be returned for a blocked A request
- `blocking_mode` (String) DNS response sent when request is blocked
- `blocking_mode` (String) DNS response sent when request is blocked. Valid values are `default`, `refused`, `nxdomain`, `null_ip` or `custom_ip`
- `bootstrap_dns` (List of String) Booststrap DNS servers
- `cache_optimistic` (Boolean) Whether optimistic DNS caching is enabled
- `cache_size` (Number) DNS cache size (in bytes)
- `cache_ttl_max` (Number) Overridden maximum TTL received from upstream DNS servers
- `cache_ttl_min` (Number) Overridden minimum TTL received from upstream DNS servers
- `cache_ttl_max` (Number) Overridden maximum TTL (in seconds) received from upstream DNS servers
- `cache_ttl_min` (Number) Overridden minimum TTL (in seconds) received from upstream DNS servers
- `disable_ipv6` (Boolean) Whether dropping of all IPv6 DNS queries is enabled
- `dnssec_enabled` (Boolean) Whether outgoing DNSSEC is enabled
- `edns_cs_enabled` (Boolean) Whether EDNS Client Subnet (ECS) is enabled
- `local_ptr_upstreams` (List of String) List of private reverse DNS servers
- `rate_limit` (Number) The number of requests per second allowed per client
- `resolve_clients` (Boolean) Whether reverse DNS resolution of clients' IP addresses is enabled
- `upstream_dns` (List of String) Upstream DNS servers
- `upstream_mode` (String) Upstream DNS resolvers usage strategy
- `upstream_mode` (String) Upstream DNS resolvers usage strategy. Valid values are `load_balance` (default), `parallel` and `fastest_addr`
- `use_private_ptr_resolvers` (Boolean) Whether to use private reverse DNS resolvers

### Read-Only

- `id` (String) Internal identifier for this dnsConfig
- `last_updated` (String) Timestamp of the last Terraform update of the dnsConfig
- `id` (String) Internal identifier for this DNS config
- `last_updated` (String) Timestamp of the last Terraform update of the DNS config

## Import

Expand Down

0 comments on commit 8216c0a

Please sign in to comment.