Implement godaddy_dns_records data source #12

Closed
opened 2026-06-14 17:26:51 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Summary

Implement data_source_dns_records.go to read existing DNS records from GoDaddy.

User Story

As a platform operator, I want to query existing DNS records via tofu plan so I can reference them without managing their lifecycle.

Context

Companion to the DNS record resource. Enables read-only access to existing records for cross-referencing and validation.

Lineage

Parent: none
Story: dns-iac

Repo

godaddy-tofu

Scope

  • Create data_source_dns_records.go implementing datasource.DataSource interface
  • Schema: domain (required), type (optional filter), name (optional filter)
  • Read: client.GetRecords(ctx, domain, type, name)
  • Output: records list with all DNSRecord fields
  • Register in provider.go DataSources() map

File Targets

  • data_source_dns_records.go (new)
  • provider.go (register data source)

Feature Flag

None

Test Expectations

  • Acceptance test coverage in separate issue
  • Manual: tofu plan with data source block reads live records

Acceptance Criteria

  • data "godaddy_dns_records" "existing" { domain = "..." } reads records
  • Type and name filters work
  • Output attributes populated correctly

Constraints

None beyond standard Plugin Framework patterns

Checklist

  • datasource.DataSource interface implemented
  • Registered in provider.go
  • Filter logic for type/name

Companion to DNS record resource

### Type Feature ### Summary Implement `data_source_dns_records.go` to read existing DNS records from GoDaddy. ### User Story As a platform operator, I want to query existing DNS records via `tofu plan` so I can reference them without managing their lifecycle. ### Context Companion to the DNS record resource. Enables read-only access to existing records for cross-referencing and validation. ### Lineage Parent: none Story: dns-iac ### Repo godaddy-tofu ### Scope - Create `data_source_dns_records.go` implementing `datasource.DataSource` interface - Schema: `domain` (required), `type` (optional filter), `name` (optional filter) - Read: `client.GetRecords(ctx, domain, type, name)` - Output: `records` list with all DNSRecord fields - Register in `provider.go` DataSources() map ### File Targets - `data_source_dns_records.go` (new) - `provider.go` (register data source) ### Feature Flag None ### Test Expectations - Acceptance test coverage in separate issue - Manual: `tofu plan` with data source block reads live records ### Acceptance Criteria - [ ] `data "godaddy_dns_records" "existing" { domain = "..." }` reads records - [ ] Type and name filters work - [ ] Output attributes populated correctly ### Constraints None beyond standard Plugin Framework patterns ### Checklist - [ ] datasource.DataSource interface implemented - [ ] Registered in provider.go - [ ] Filter logic for type/name ### Related Companion to DNS record resource
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/godaddy-tofu#12
No description provided.