Commit Graph

23 Commits

Author SHA1 Message Date
James Healy ae7df37e6f Make dnsimple_records importable (#9130)
* Make dnsimple_records importable

terraform 0.7 supports importing a resource into the local state, and
this adds that feature to the dnsimple_record resource.

Unfortunately, the DNSimple v1 API requires a domain name and record ID
to fetch a record, so the import command accepts both pieces of data as
a slash-delimted string like so:

    terraform import dnsimple_record.test example.com/1234

* add an acceptance test for importing a dnsimple_record
2017-04-27 02:07:23 +12:00
Paul Stack 00e8986357 provider/dnsimple: Handle 404 on DNSimple records (#13131)
When a record was manually deleted from the console, we got an error
saying 404 Record Not Found

//cc @weppos

This PR now handles the usecase:

```
% make testacc TEST=./builtin/providers/dnsimple
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/28 21:48:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/dnsimple -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDNSimpleRecord_Basic
--- PASS: TestAccDNSimpleRecord_Basic (1.81s)
=== RUN   TestAccDNSimpleRecord_CreateMxWithPriority
--- PASS: TestAccDNSimpleRecord_CreateMxWithPriority (1.32s)
=== RUN   TestAccDNSimpleRecord_Updated
--- PASS: TestAccDNSimpleRecord_Updated (4.46s)
=== RUN   TestAccDNSimpleRecord_disappears
--- PASS: TestAccDNSimpleRecord_disappears (1.20s)
=== RUN   TestAccDNSimpleRecord_UpdatedMx
--- PASS: TestAccDNSimpleRecord_UpdatedMx (2.91s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/dnsimple	11.723s
```
2017-04-12 20:49:04 +02:00
James Healy 593a0c699b Allow dnsimple_record.priority attribute to be set (#12843)
* Allow priority attribute of dnsimple_record to be set

Some DNS record types (like MX) allow a priority to specified, and the
ability to do so is important in many environments.

This diff will change dnsimple_record.priority from computed to
optional, allowing it to be used in terraform configs like so:

    resource "dnsimple_record" "mx1" {
        domain = "example.com"
        name = ""
        value = "mx1.example.com"
        type = "MX"
        priority = "1"
    }

    resource "dnsimple_record" "mx2" {
        domain = "example.com"
        name = ""
        value = "mx2.example.com"
        type = "MX"
        priority = "2"
    }

* mention new priority attribute of dnsimple_record

* add acceptance specs for creating/updating MX records at dnsimple
2017-03-18 13:04:48 +00:00
Paul Stack e973176bb9 provider/dnsimple: Don't prompt the user for email address (#12619)
As part of the new changes to the DNSimple provider, we changed to use
the new API version. This requires a token and *not* email address

In order for backwards compatibility - we kept the email address in the
schema but we had the default as nil, meaning that Terraform was
prompting the user for it, they would enter it, then Terraform would
error out due to using a combination of token and email address

This commit makes the default email address an empty String. This means
we don't prompt the user
2017-03-13 10:07:53 +02:00
Simone Carletti 8ae31740e3 Upgrade DNSimple provider to API v2 (#10760)
* Replace DNSimple API client with the official Go client

* Upgrade DNSimple provider to use the new API v2

Acceptance tests pass:

```
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccDNSimpleRecord_Basic
--- PASS: TestAccDNSimpleRecord_Basic (2.67s)
=== RUN   TestAccDNSimpleRecord_Updated
--- PASS: TestAccDNSimpleRecord_Updated (1.88s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/dnsimple
```

Note that the code still has to be updated to pass the account ID
dynamically in place of "TODO-ACCOUNT".

* Refactor DNSimple provider to expose both client and config

The config is required as the new API wants to know the identifier of
the account you are operating to. The account is not stored in the
client (as the client can talk with different accounts), hence I need
to pass it as part of the config.

* Identify Terraform requests to DNSimple via UserAgent

* Upgrade to the latest dnsimple-go version

* Update docs

Provide upgrade instructions and update the docs for API v2.

* Remove rendundant type declaration
2017-03-02 05:12:34 +00:00
David Radcliffe f1cc9fafb3 “DNS Simple” should be “DNSimple” 2015-07-17 23:18:28 -04:00
David Radcliffe 94ef573b66 DNSimple does not support changing a record domain or type 2015-07-17 17:06:01 -04:00
Clint Shryock f6bcc302d3 providers/aws+cloudflare+dnsimple: Increase some verbosity 2015-05-18 15:25:03 -05:00
Justin Campbell 6f4b7b25c6 providers/dnsimple: default ttl to 3600
Since the field is optional and DNSimple defaults it to 3600 on their end, `terraform plan` currently will report `ttl: "3600" => ""`.
2015-04-28 09:20:23 -04:00
Jeff Mitchell f2bd1f45ab Move duplicated envDefaultFunc out of each provider and into Schema. 2015-01-16 17:25:39 +00:00
Sander van Harmelen 4e94af3644 Removing obsolete struct tags 2014-11-17 18:58:41 +01:00
Sander van Harmelen cdee8c70ec Refactoring the DNSimple provider
With this refactor the DNSimple provider is updated to use the
schema.Provider approach released with TF 0.2.
2014-11-17 14:01:00 +01:00
Mitchell Hashimoto 459ffe9d2a providers/*: fix compilation for input 2014-09-29 10:28:08 -07:00
Mitchell Hashimoto 9b2b3a963f ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
Mitchell Hashimoto c2a2aca999 providers/dnsimple: tests passing, compiling 2014-09-16 17:24:05 -07:00
Jack Pearkes 307f7e4e5b providers/dnsimple: fix comment 2014-07-25 12:05:51 -04:00
Jack Pearkes 454db657be providers/dnsimple|heroku: handle ComputedAttrsUpdate 2014-07-24 23:29:58 -04:00
Jack Pearkes 228c8db134 providers/dnsimple: add hostname as computed resource 2014-07-24 19:32:59 -04:00
Jack Pearkes 298483131b providers/aws: fixed tons of aws stuff 2014-07-24 18:50:33 -04:00
Jack Pearkes ae7db9359e providers/dnsimple: finish update func, new lib 2014-07-24 11:23:10 -04:00
Jack Pearkes 2f4ea10349 dnsimple: fix for new library 2014-07-24 10:21:50 -04:00
Jack Pearkes 07d9bb03ec providers/dnsimple: handle custom domains 2014-07-23 20:53:28 -04:00
Jack Pearkes d8c83a1a95 providers/dnsimple: init commit 2014-07-23 17:43:49 -04:00