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

Support for HTTPs redirects #130

Closed sandstrom closed 1 year ago

sandstrom commented 1 year ago

It seems like the terraform provider doesn't support setting up HTTPS redirects.

We're considering moving ~30 domains from Gandi to DNSimple. For some of them we'll delegate DNS to AWS Route 53, and have actual web servers. For them, redirects are easy.

But we also have a bunch of "parked domains", we're we're currently letting Gandi handle http/https HTTP redirects (304) to the canonical domain [without having to manage an HTTP server ourselves].

It seems like DNSimple have support for this, which is great, but there doesn't seem to be support in the Terraform provider.

Is this something you've considered adding?

image

DXTimer commented 1 year ago

@sandstrom HTTP redirects are configured in the form of a custom DNS record called URL record. Therefore, you can use the dnsimple_zone_record, to configure redirects for the domains.

Example:

resource "dnsimple_zone_record" "foobar" {
  zone_name = "vegan.pizza"
  name   = ""
  value  = "https://foo.com"
  type   = "URL"
  ttl    = 3600
}

Since you mentioned HTTPS explicitly, I want to bring your attention to the requirements that we have for HTTPS redirects which is that there needs to be a TLS certificate managed at DNSimple for those domains, you can learn more in the support article which you can find here. The good news is that you can also issue certificates through terraform via the dnsimple_lets_encrypt_certificate resource.

Let me know if you need some assistance, also feel free to reach out to support any time.

sandstrom commented 1 year ago

Great, thanks @DXTimer!