Commit Graph

23 Commits

Author SHA1 Message Date
Jake Champlin e052ded267
add missing return 2017-02-16 07:57:34 -05:00
Jake Champlin 179aa62ad4
provider/cloudflare: Fix record validation
Previously we only validated that the cloudflare record provided was a valid record type. However, a record can be of a valid type, and still not be proxied, making it an invalid record type.

The main downside to having to check for whether or not the record type is proxied or not during validation, is that it relies on having two schema keys populated. This means that we can only catch the improper record type during `apply` time, instead of `plan` time.

```
$ go test -v -run "TestValidateRecordType" ./builtin/providers/cloudflare
=== RUN   TestValidateRecordType
--- PASS: TestValidateRecordType (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/cloudflare     0.004s
```
2017-02-15 21:52:04 -05:00
Jake Champlin 6a31ed5ee8
Use a better format in error output 2017-01-13 15:43:47 -05:00
Jake Champlin 8ac7f53c33
provider/cloudflare: Add validation for record types and record content
Adds a validation function for cloudflare record types. Also adds an apply-time validation for the record's content based on record type. Currently only validating `A` and `AAAA` records, can be expanded to verify record content for every possible record type in the future.

```
$ make test TEST=./builtin/providers/cloudflare
==> Checking that code complies with gofmt requirements...
==> Checking AWS provider for unchecked errors...
==> NOTE: at this time we only look for uncheck errors in the AWS package
==> Installing errcheck...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/13 14:41:37 Generated command/internal_plugin_list.go
TF_ACC= go test ./builtin/providers/cloudflare  -timeout=30s -parallel=4
ok      github.com/hashicorp/terraform/builtin/providers/cloudflare     0.018s
```

Fixes: #11173
2017-01-13 14:42:13 -05:00
Clint 7d23570e2d provider/cloudflare: Add migration for v1 to v4 API libraries (#6969)
* provider/cloudflare: Add migration for v1 to v4 API libraries

- mock out api calls
2016-06-07 14:29:25 -05:00
clint shryock 943583925d provider/cloudfront: Minor adjustments for new cloudflare-go lib 2016-06-06 14:57:26 -05:00
clint shryock d70d7aba57 provider/cloudflare: Swap out mitchellh fork for upstream cloudflare-go
TODO noted that this should be done when a PR was merged, and it has so
2016-06-06 14:48:05 -05:00
Mitchell Hashimoto 109b3f5198
providers/cloudflare: use cloudflare-go
The most improtant change is using record IDs as identifiers.
2016-05-03 09:48:50 -07:00
Mitchell Hashimoto a7311fa68f
providers/cloudflare: record can manage apex records
Apex records must be created by specifying "@" as the name, but this
caused Refresh and Delete errors.
2016-05-03 09:48:50 -07:00
Alexander Simmerl 251075564a provider/cloudflare: Add proxied option (#5508)
This change adds the support for the proxied configuration option for a
record which enables origin protection for CloudFlare records.

In order to do so the golang library needed to be changed as the old did
not support the option and was using and outdated API version.

Open issues which ask for this (#5049, #3805).
2016-04-27 18:04:07 +01:00
stack72 b8778b8a3a provider/cloudflare: Change `cloudflare_record` type to ForceNew. The
CloudFlare API does not allow types to be changed (i.e. A to CNAME)
after creation
2016-02-27 00:43:06 +00:00
stack72 46f51b7bd8 provider/cloudflare: Change CloudFlare record TTL property to be
`computed`
2016-02-07 22:33:21 +00:00
Mitchell Hashimoto 05bc835748 providers/cloudflare: if resource no longer exists, set ID to ""
[GH-301]
2015-06-28 23:28:12 -07:00
Clint Shryock f6bcc302d3 providers/aws+cloudflare+dnsimple: Increase some verbosity 2015-05-18 15:25:03 -05:00
Alan Grosskurth 023b2f94eb providers/cloudflare: Better error message
Currently, if a record isn't found, we get an error like:

    Couldn't find record: Record not found

This change improves the error message to add more context:

    Couldn't find record ID (123456789) for domain (example.com): Record not found
2015-04-29 13:49:16 -07: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 11f024a8e7 Removing obsolete struct tags 2014-11-17 18:57:41 +01:00
Sander van Harmelen a270bc9771 Refactoring the CloudFlare provider
With this refactor the CloudFlare provider is updated to use the
schema.Provider approach released with TF 0.2.
2014-11-17 14:03:57 +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 78471d2aa0 providers/cloudflare: tests passing, compiles 2014-09-16 17:31:07 -07:00
Jack Pearkes 9998339a04 website: add cloudflare docs 2014-07-25 12:28:11 -04:00
Jack Pearkes 85944ab205 providers/cloudflare: init 2014-07-25 12:21:23 -04:00