terraform-community-providers / terraform-provider-railway

Terraform provider for railway.app
https://registry.terraform.io/providers/terraform-community-providers/railway/latest/docs
Mozilla Public License 2.0
22 stars 1 forks source link

Support custom domains #11

Closed pksunkara closed 1 year ago

pksunkara commented 1 year ago

Railway supports custom domain creation, but it doesn't let us retrieve the CNAME record for the custom domain.

To fix: Railway needs to add the DNS record to the CustomDomain type in graphql.

Why is this important? It's so that we can use terraform to take this DNS record and add it to our DNS records (cloudflare) without any manual intervention.


query {
  domains(
    environmentId:"d2b367de-b363-4455-b842-e60cda62a385",
    serviceId:"89fa0236-2b1b-4a8c-b12d-ae3634b30d97",
    projectId:"0bb01547-570d-4109-a5e8-138691f6a2d1"
  ) {
    customDomains {
      id
      cnameCheck {
        link
        message
        status
      }
      domain
    }
    serviceDomains {
      id
      domain
      suffix
    }
  }
}
gschier commented 1 year ago

Hey there! I just shipped an update to your API to enable this. The CustomDomain type now includes a status sub-object with a bunch of useful info related to DNS and certificate generation. There's also a new customDomain (not sure if applicable).

CleanShot 2023-07-24 at 16 07 28@2x