dnsimple / terraform-provider-dnsimple

Terraform DNSimple provider.
https://www.terraform.io/docs/providers/dnsimple/
Mozilla Public License 2.0
21 stars 20 forks source link

Error creating entries on second domain #35

Closed JohnShortland closed 2 years ago

JohnShortland commented 3 years ago

Terraform Version

1.0

Affected Resource(s)

Terraform Configuration Files

resource "dnsimple_record" "portal" {
  domain = "${var.stack}.${var.environment}.${var.domain}"
  name   = "portal"
  value  = "${var.stack}.${var.environment}.${var.domain}"
  type   = "CNAME"
  ttl    = 60
}

resource "dnsimple_record" "vanity-portal" {
  domain = "${var.environment}.${var.domain}"
  name   = "portal"
  value  = dnsimple_record.portal.hostname
  type   = "URL"
  ttl    = 60
}

Debug Output

Error: Failed to create DNSimple Record: POST https://api.dnsimple.com/v2/000000/zones/prototype.example.com/records: 400 Validation failed
│ 
│   with dnsimple_record.vanity-portal,
│   on dns.tf line 50, in resource "dnsimple_record" "vanity-portal":
│   50: resource "dnsimple_record" "vanity-portal" {

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

The second "vanity" domain URL should be created.

Actual Behavior

400 Validation failed

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
weppos commented 2 years ago

Hi @JohnShortland, sorry for the late follow up. It sounds like you hit a validation error (I see the HTTP 400 response). I can't tell exactly what the issue was as it depends on the state of the zone in that moment.

However, the good news is that we've made changes to surface the validation errors, so next time it should be easier to understand what went wrong.