n3integration/terraform-provider-godaddy

godaddy_domain_record.mydomain: data must be between 1..255 characters in length

scream314 opened this issue · 4 comments

I am trying to use a GoDaddy domain with Terraform, but if I apply the config the following error happens:

* godaddy_domain_record.mydomain: data must be between 1..255 characters in length

The record causing this error must be the "SOA" record, which has an empty data:

  record
  {
    name = "@"
    type = "SOA"
    data = ""
    ttl = 600
  }

If the record type is SOA, an empty data should be allowed.

Ok, I tried to change the validation to accept SOA-type records with data length of 0.
The error message changed to:

* godaddy_domain_record.mydomain: [422:INVALID_BODY] Request body doesn't fulfill schema, see details in `fields`

Any ideas?

* godaddy_domain_record.mydomain: [422:INVALID_BODY] Request body doesn't fulfill schema, see details in `fields` {"code":"INVALID_BODY","message":"Request body doesn't fulfill schema, see details in `fields`","fields":[{"code":"INVALID_VALUE","message":"is not one of enum values: \"A\", \"AAAA\", \"CNAME\", \"MX\", \"NS\", \"SRV\", \"TXT\"","path":"records[1].type"}],"name":"ApiError"}

Interesting, apparently modifying SOA records is not allowed...

#19 please

I was trying to recreate my GD domain exactly in Terraform, so used the GoDaddy API output to create my godaddy_domain_record (to be 100% sure I add all existing records), so I also added "SOA" before the first apply. This was a bad idea, you cannot delete SOA via API calls.

To avoid this issue completely, we should first create the godaddy_domain_record without a SOA record, terraform apply, and then add the SOA to prevent plan from detecting a change every time.

I think this should be in the README.

Ok, I think this can be closed.