This repository has been archived on 2026-08-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
terraform-provider-dynu/README.md
T
beatzaplentyandClaude Sonnet 4.6 70bb75ad46
ci / test (push) Failing after 5m55s
bump to v0.2.0: complete provider implementation with live-tested DNS record types
- 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
2026-08-03 23:40:27 +10:00

128 lines
2.4 KiB
Markdown

# terraform-provider-dynu
A standalone Terraform provider for Dynu DNS and domain management.
## Features
- Full CRUD for Dynu root domains via `dynu_domain`.
- Full CRUD for Dynu DNS records via `dynu_dns_record`.
- Read-only discovery data sources:
- `dynu_domains`
- `dynu_domain`
- `dynu_dns_records`
- Provider authentication via explicit `api_key` configuration.
## Important safety note
Deleting `dynu_domain` deletes the full Dynu DNS zone for that domain. Treat destroy plans carefully.
## Minimal usage example
```hcl
terraform {
required_providers {
dynu = {
source = "beatz174-bit/dynu"
version = "~> 0.2.0"
}
}
}
provider "dynu" {
api_key = var.dynu_api_key
}
variable "dynu_api_key" {
type = string
sensitive = true
}
```
## Resources
- `dynu_domain`
- `dynu_dns_record`
## Data sources
- `dynu_domains`
- `dynu_domain`
- `dynu_dns_records`
## Local development and dev overrides
For local development, use `dev_overrides` with a local build of this provider binary.
```bash
go build -o terraform-provider-dynu
```
`~/.terraformrc`:
```hcl
provider_installation {
dev_overrides {
"beatz174-bit/dynu" = "/path/to/terraform-dynu-provider"
}
direct {}
}
```
Validate locally:
```bash
cd examples/read_only
cp terraform.tfvars.example terraform.tfvars
terraform validate
terraform plan
```
If provider code/config changes, rebuild `terraform-provider-dynu` before running Terraform again.
## Testing
```bash
./scripts/fix.sh
./scripts/check.sh
go test ./...
go vet ./...
terraform fmt -check -recursive examples
```
### Optional live acceptance tests
Live tests are opt-in and destructive for test records. They never run by default.
```bash
DYNU_ACC=1 \
DYNU_ACC_API_KEY="***" \
DYNU_ACC_TEST_DOMAIN="example.com" \
./scripts/testacc.sh --live
```
Use a disposable domain/subdomain only.
## Release
- Terraform provider source address: `beatz174-bit/dynu`.
- Repository name must remain `terraform-provider-dynu`.
- Releases are triggered by pushing a semantic version tag such as `v0.2.0`.
- Required GitHub Actions secrets:
- `GPG_PRIVATE_KEY`
- `PASSPHRASE`
- Add the matching public GPG key to Terraform Registry before publishing, so signature verification succeeds.
Build a local stamped binary:
```bash
./build.sh v0.1.0
```
Create and push a release tag:
```bash
git tag v0.1.0
git push origin v0.1.0
```