timohirt / terraform-provider-hetznerdns

Terraform provider for Hetzner DNS
Mozilla Public License 2.0
106 stars 21 forks source link

Suggestion: Support IDNs #28

Open ThomasLandauer opened 3 years ago

ThomasLandauer commented 3 years ago

When the domain name contains an umlaut, I'm getting this error:

Error: Error creating zone. API returned HTTP 422 Unprocessable Entity error with message: '422 Unprocessable Entity: invalid invalid character for domain name'

So I'm suggesting that you're including the conversion to punycode in the provider - especially since (after a quick search) I couldn't find a conversion function in Terraform, so right now the conversion has to be done outside of Terraform (i.e. manually).

c33s commented 3 years ago

as workaround you can try using external data provider

something like this should work

// returns json {"name": "......"}
data "external" "exaemple_com" {
  program = ["bash", "${local.bin_dir}/convert-umlauts.sh", "exämple.com"]
}

// access it with 
data.external.exaemple_com.result.name
kimdre commented 3 months ago

Hi, we created a new fork of this project as this one is no longer maintained and added a bunch of additional features including a built in function for IDN/Punycode support.

You can find it here: https://registry.terraform.io/providers/germanbrew/hetznerdns/latest/docs/functions/idna