Custom OpenTofu provider for GoDaddy API — DNS records and domain management as IaC
Find a file
Lucas Draney b36140ee3f
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add Woodpecker CI pipeline for build and integration tests
Runs go build, go vet, and pkg/godaddy/ integration tests on every
push and PR. Uses repo secrets for GoDaddy API credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-14 13:53:54 -06:00
docs Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
pkg/godaddy Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
.gitignore Initialize repo with README and gitignore 2026-06-13 08:51:40 -06:00
.woodpecker.yml Add Woodpecker CI pipeline for build and integration tests 2026-06-14 13:53:54 -06:00
CLAUDE.md Add docs foundation: README, CLAUDE.md, swagger specs (#2) 2026-06-13 15:30:56 +00:00
data_source_dns_records.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
data_source_dns_records_test.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
data_source_domains.go Implement godaddy_domains data source (#28) 2026-06-14 18:00:55 +00:00
go.mod Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
go.sum Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
main.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
provider.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
provider_test.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
README.md Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
resource_dns_record.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00
resource_dns_record_test.go Revert "Add Woodpecker CI pipeline for build and integration tests" 2026-06-14 13:53:30 -06:00

godaddy-tofu

Custom OpenTofu provider for the GoDaddy API. Manages DNS records and domains as infrastructure-as-code.

Replaces abandoned community providers (veksh/godaddy-dns, n3integration/godaddy) — one of which deletes unmanaged records on apply. Built in Go with the Terraform Plugin Framework, consumed by pal-e-platform/terraform/ to manage DNS for palinks.app, landscaping-assistant.app, and future domains.

Quick Start

provider "godaddy" {
  api_key    = var.godaddy_api_key
  api_secret = var.godaddy_api_secret
}

resource "godaddy_dns_record" "palinks_a" {
  domain = "palinks.app"
  type   = "A"
  name   = "@"
  data   = "178.156.129.142"
  ttl    = 600
}

data "godaddy_domains" "all" {}

Build & Test

go build -o terraform-provider-godaddy

GODADDY_API_KEY=... GODADDY_API_SECRET=... go test ./pkg/godaddy/ -v

TF_ACC=1 GODADDY_API_KEY=... GODADDY_API_SECRET=... go test ./... -v

go install .

Documentation

Doc Description
Architecture Provider internals, client class diagram, API mapping, auth flow, testing strategy
Deployment End-to-end flow, Hetzner edge proxy, traffic path, infrastructure layers
DNS Endpoints P0 DNS record management reference
Auth Guide Credential setup and sso-key format
API Groups All 10 GoDaddy API groups, endpoint counts, swagger links
Conventions Plugin Framework best practices, testing patterns, error handling

Resources & Data Sources

Type Name GoDaddy API Priority
Resource godaddy_dns_record PUT /v1/domains/{domain}/records/{type}/{name} P0
Resource godaddy_domain PATCH /v1/domains/{domain} P1
Data Source godaddy_dns_records GET /v1/domains/{domain}/records/{type}/{name} P0
Data Source godaddy_domains GET /v1/domains P1

Project Structure

godaddy-tofu/
  main.go                          # provider entry point
  provider.go                      # provider config, auth, resource registration
  resource_dns_record.go           # godaddy_dns_record CRUD
  resource_domain.go               # godaddy_domain CRUD
  data_source_dns_records.go       # godaddy_dns_records read
  data_source_domains.go           # godaddy_domains read
  pkg/godaddy/
    client.go                      # HTTP client, sso-key auth, base URL
    dns.go                         # DNS record API methods
    domains.go                     # Domain API methods
    *_test.go                      # integration tests (live API)
  docs/                            # see Documentation table above