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

Adding sandbox flag #12

Closed visitjonathan closed 4 years ago

visitjonathan commented 5 years ago

Pull request to add a flag enabling the ability to use the DNSimple Sandbox.

The sandbox API is 'api.sandbox.dnsimple.com', while the production DNSimple API is 'api.dnsimple.com'.

Without this change the Terraform DNSimple provider can only connect to the DNSimple production API.

The production API URL is defined in a const (defaultBaseURL) in the https://github.com/dnsimple/dnsimple-go/blob/master/dnsimple/dnsimple.go project, which is imported by this Terraform provider (config.go). At some later stage the 'defaultSandboxURL' const below could be submitted to that dnsimple-go project as a separate PR.

martinisoft commented 5 years ago

Hi @visitjonathan you may need to update your code for the recent Go 1.11 changes they made to prepare this provider for the upcoming Terraform 0.12 release

weppos commented 5 years ago

@vishalnayak @martinisoft I wonder if rather than having a flag, perhaps the code should accept an different URL. The Go client already works in this way, where you can provide whatever API endpoint you prefer.

In this way further environments can be used if DNSimple would ever provide more (in fact we have one more for internal use).

The change will also remove the requirement to hardcode the URL in this module. Basically, the change could add a new configurable option to allow to use a different base URL.