ionos-cloud / terraform-provider-ionoscloud

The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.
Mozilla Public License 2.0
34 stars 23 forks source link

dns record for zone no empty string passed to api #497

Closed Syndlex closed 9 months ago

Syndlex commented 9 months ago

Description

It is not possible to create a record for the zone.

https://github.com/ionos-cloud/terraform-provider-ionoscloud/blob/master/services/dns/record.go#L134C22-L134C22 This should also add a empty string as name to the request in case we want to edit the zone.

It would be better if we could use "@" as the origin as statet in the RFCs for DNS zonefiles. https://en.wikipedia.org/wiki/Zone_file

code to reproduce

resource "ionoscloud_dns_record" "zone_tls_txt" {
  content = "a924g9cm3cqt07f269lusinhfo"
  name    = ""
  type    = "TXT"
  zone_id = ionoscloud_dns_zone.test.id
}

Expected behavior

create a record for the passed zone

Error and Debug Output

result:

╷
│ Error: an error occured while creating a record for the DNS zone with ID: 98f62e0c-bd9e-58a6-8611-8ed19ea8db1e, error: 422 Unprocessable Entity: {"httpStatus":422,"messages":[{"errorCode":"paas-validation-3","message":"'property \"name\" is missing' caused by field '/properties/name'"}]}
│ 
│ 
│   with ionoscloud_dns_record.zone_tls_caa,
│   on dns.tf line 19, in resource "ionoscloud_dns_record" "zone_tls_caa":
│   19: resource "ionoscloud_dns_record" "zone_tls_caa" {
│ 

Additional Notes

Internal Ticket: [Ticket#:207147470]

cristiGuranIonos commented 8 months ago

Fixed in v6.4.11