Custom OpenTofu provider for GoDaddy API — DNS records and domain management as IaC
- Go 100%
|
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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> |
||
|---|---|---|
| docs | ||
| pkg/godaddy | ||
| .gitignore | ||
| .woodpecker.yml | ||
| CLAUDE.md | ||
| data_source_dns_records.go | ||
| data_source_dns_records_test.go | ||
| data_source_domains.go | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| provider.go | ||
| provider_test.go | ||
| README.md | ||
| resource_dns_record.go | ||
| resource_dns_record_test.go | ||
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