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/examples/live_end_to_end_dns_zone
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
..

Live End-to-End Dynu DNS Zone Example

Warning

This is a live destructive test.

  • Do not use a real production domain.
  • Use only a disposable test domain.
  • terraform destroy will remove the test domain and all records created by this example.

This example performs full live validation of the Dynu provider lifecycle by creating and then destroying a disposable Dynu domain plus one DNS record for each currently supported record type in this provider example:

  • A
  • AAAA
  • CNAME
  • MX
  • TXT
  • SRV
  • CAA

Prerequisites

  • A local build of this provider with Terraform dev_overrides for beatz174-bit/dynu.
  • Dynu API key provided as Terraform variable dynu_api_key (for example via terraform.tfvars).
  • A disposable domain value for test_domain.

Required variables

Create terraform.tfvars in this folder:

test_domain = "my-disposable-test-domain.example"
dynu_api_key = "..."

Commands

terraform init
terraform validate
terraform plan
terraform apply
terraform plan
terraform destroy

Expected results

  • terraform validate should pass.
  • First terraform plan should show creation of:
    • one disposable test domain (dynu_domain.test), and
    • one record each for A, AAAA, CNAME, MX, TXT, SRV, and CAA.
  • terraform apply should create the domain and records.
  • Second terraform plan (after apply) should show no changes.
  • Manually verify in the Dynu web UI that the test domain and records exist after apply.
  • terraform destroy should remove the test domain and all records from state.
  • Final manual verification should confirm the test domain is gone from Dynu.