Archived
bump to v0.2.0: complete provider implementation with live-tested DNS record types
ci / test (push) Failing after 5m55s
ci / test (push) Failing after 5m55s
- DYNU_API_KEY env var fallback in provider config - dynu_domain resource: add 9 computed attributes (unicode_name, ipv4/ipv6 flags, wildcard aliases, allow_zone_transfer, dnssec, created_on, updated_on) - dynu_dns_records data source: add 6 type-specific fields (priority, weight, port, flags, tag, value) - Fix normalizeRecordContentForState for MX/SRV/NS/PTR (read host field) and CAA (read value field) to avoid plan/state inconsistency - Allow underscore-prefixed DNS labels in hostname validator (RFC 2782 SRV) - Preserve plan/state hostname across create/update/read to prevent inconsistent result errors when API returns full FQDN for node_name-style records - Update all version references from 0.1.0 to 0.2.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFZyrmtKsezBwFWGTWsb2y
This commit is contained in:
@@ -2,6 +2,7 @@ package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
@@ -47,7 +48,7 @@ func (p *dynuProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp
|
||||
"api_key": schema.StringAttribute{
|
||||
Optional: true,
|
||||
Sensitive: true,
|
||||
Description: "Dynu API key. Set this explicitly, such as via a Terraform variable in terraform.tfvars.",
|
||||
Description: "Dynu API key. Can also be set via the DYNU_API_KEY environment variable.",
|
||||
},
|
||||
"base_url": schema.StringAttribute{
|
||||
Optional: true,
|
||||
@@ -82,9 +83,11 @@ func (p *dynuProvider) Configure(ctx context.Context, req provider.ConfigureRequ
|
||||
|
||||
func resolveAPIKey(configValue types.String) string {
|
||||
if !configValue.IsNull() && !configValue.IsUnknown() {
|
||||
return strings.TrimSpace(configValue.ValueString())
|
||||
if v := strings.TrimSpace(configValue.ValueString()); v != "" {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return ""
|
||||
return strings.TrimSpace(os.Getenv("DYNU_API_KEY"))
|
||||
}
|
||||
|
||||
func (p *dynuProvider) DataSources(_ context.Context) []func() datasource.DataSource {
|
||||
|
||||
Reference in New Issue
Block a user