I added a domain to my personal organisation using the following command:
flyctl domains add personal staging.mysite.com
This domain is now no longer needed, but I’m unsure how to remove it, as there are no domains remove or domains delete commands.
I think I also don’t need other domain records that I created, as they seem to only be necessary when using Fly’s own nameservers (I am using NS1) however I didn’t initially realise this from reading the docs.
Can you confirm if it’s necessary to add a domain when using non-Fly nameservers, and confirm whether or not it’s possible to remove a domain that’s no longer needed?
You only need to use domains when using fly’s DNS or registering a domain. To add SSL to your apps you want flyctl certs. Domains is in preview and I don’t remember why there isn’t a delete command yet, but I can remove it for you. Could you DM me your org name or email?
I’m not sure how to send a DM (maybe I don’t have permissions being a newish forum user?), however my org name is ‘David Bailey’ with the personal slug, and my account is the owner of the app davidbailey-codes. Seeing as I’m not using Fly DNS, I’m happy for you to remove all the domains I added (*.davidbailey.codes)
Has the feature to move/remove a domain already been added? I’m doing a bit of spring cleaning after testing fly to move things in production and would like to setup the orgs, domains a bit more properly.
Will this asymmetry in the CLI be eliminated, e.g. I can add/register domains, but not remove them myself thereafter?
Actually, similar asymmetry exists with organizations in the current WebUI. However, the CLI supports both add and delete of organizations.
Why should it be different with domains?
Edit: I just noticed that the GraphQL API already exposes DeleteDomain(), next to DeleteOrganisation(), see tab “DOCS” in its Playground.
Are there any reasons not to expose it via the CLI as well, or to use in a Terraform Provider which @DAlperin is developing?
Yeah, I currently use those apis in the terraform provider I believe. But agree it would be nice for debugging/fixing to have access via the cli. @hb9cwp if you wanted I think it would be pretty easy to PR this in to flyctl.
Indeed, I am just trying to get the hang of it by looking at Response after sending Queries & Mutations by curl and in the GraphQL Playground to the API endpoint, as documented in Domain Reseller Guide that was announced here.
Also, I have been looking at GraphQL API client libraries that are written in Go, such as this one, which would go well together with the Terraform Provider SDK in Go…
The reason I didn’t build on those examples are because graphql is the easy part. The slightly more difficult part is writing the logic to reconcile resources. One terraform resource might make multiple different requests and compile them in to the terraform schema. It’s easier for me to just have complete control, because it removes a lot of overhead for me to learn.