This issue was originally opened by @mdkent as hashicorp/terraform#8944. It was migrated here as part of the provider split. The original body of the issue is below.
Having some issues trying to manage a TXT record on a top level domain.
Terraform Version
Terraform v0.7.3
Affected Resource(s)
dyn_record
Terraform Configuration Files
resource "dyn_record" "spf" {
zone = "test.com"
name = ""
value = "v=spf1 include:_spf.test.com include:amazonses.com -all"
type = "TXT"
ttl = 300
}
Expected Behavior
Terraform creates a TXT record on test.com and doesn't attempt to set it on a subsequent run.
Actual Behavior
Plan:
+ dyn_record.spf
fqdn: "<computed>"
ttl: "300"
type: "TXT"
value: "v=spf1 include:_spf.test.com include:amazonses.com -all"
zone: "test.com"
Plan: 1 to add, 0 to change, 0 to destroy.
which is already incorrect, the record exists in dyn.
Apply:
Terraform v0.7.3
Setting up remote state...
Downloading remote modules...
Refreshing Terraform state prior to plan...
dyn_record.spf: Creating...
fqdn: "" => "<computed>"
ttl: "" => "300"
type: "" => "TXT"
value: "" => "v=spf1 include:_spf.test.com include:amazonses.com -all"
zone: "" => "test.com"
Error applying plan:
1 error(s) occurred:
* dyn_record.spf: Failed to create Dyn record: Bad response, got "400 Bad Request"
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
This issue was originally opened by @mdkent as hashicorp/terraform#8944. It was migrated here as part of the provider split. The original body of the issue is below.
Having some issues trying to manage a TXT record on a top level domain.
Terraform Version
Terraform v0.7.3
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform creates a TXT record on test.com and doesn't attempt to set it on a subsequent run.
Actual Behavior
Plan:
which is already incorrect, the record exists in dyn.
Apply:
The documentation on https://www.terraform.io/docs/providers/dyn/r/record.html doesn't make mention of setting name to an empty string to add records to the tld, maybe this isn't well tested?
I've also tried modifying an A record on the domain without success.
There's a chance this may be a permissions issue with my API user, but it's seemingly able to modify records below the top level domain just fine.