Archived
1.7 KiB
1.7 KiB
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 destroywill 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_overridesfordynu/dynu. - Dynu API key provided either by:
- environment variable
DYNU_API_KEY, or - Terraform variable
dynu_api_key.
- environment variable
- 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 = "..." # optional if DYNU_API_KEY is exported
Commands
terraform init
terraform validate
terraform plan
terraform apply
terraform plan
terraform destroy
Expected results
terraform validateshould pass.- First
terraform planshould show creation of:- one disposable test domain (
dynu_domain.test), and - one record each for A, AAAA, CNAME, MX, TXT, SRV, and CAA.
- one disposable test domain (
terraform applyshould 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 destroyshould remove the test domain and all records from state.- Final manual verification should confirm the test domain is gone from Dynu.