-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare API Support #9040
Comments
Hi @omarabid! In an ideal world Terraform would be able to create everything, but with finite development time it's necessary to prioritize. If you have some specific use-cases in mind that would be helped by new resources in Terraform it would help a lot if you could describe them a little, which will help to understand which of the Cloudflare concepts would be most useful/valuable. |
Personally I'd particularly like to see Page Rules supported in Terraform. |
Yeh, Page Rules support would be excellent. |
+1 to page rules. |
I agree with page rules as most important. Crypto>SSL and automatic HTTPS rewrites (and the other Boolean toggles on that page) are potentially low-hanging but juicy fruit too though. It doesn't seem like it'd be too difficult (just time-consuming) to implement something else using the existing records implementation as a reference - are you open to PRs for this? |
New private beta Load Balancer feature is also worth to implement. |
@cemo We're going to push support for our LB API to our Go library "soon" - if you'd like to collaborate on the Terraform integration we're open to it! (Matt S @ Cloudflare) |
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp#9040.
@jonleighton @jamestyrrell @mwarkentin - Please feel free to test Page Rules with my branch (#11249) - everything I've tested 'works', in so far as the rules are created. I am seeing an error coming out of the cloudflare-go library though, which stops terraform saving the state. I'm 90% sure it's a problem in the lib, but I could have done something wrong... YMMV so if any of you do have a chance to test (with some kind of demo, or a copy of something existing, not production of course!) it may be helpful in tracking it down. 🙂 |
It's possible that an API change has our v4 API returning an integer for a
value but accepting a string.
Hence, the API response doesn't marshal into a map[string]string.
Debugging should be possible by dumping the response before we marshal.
I'll attempt to take a look at this soon.
…On Thu, Jan 19, 2017 at 11:18 PM Ollie Ford ***@***.***> wrote:
@jonleighton <https://github.com/jonleighton> @jamestyrrell
<https://github.com/jamestyrrell> @mwarkentin
<https://github.com/mwarkentin> - Please feel free to test Page Rules
with my branch (#11249 <#11249>)
- everything I've tested 'works', in so far as the rules are created.
I am seeing an error coming out of the cloudflare-go library though, which
stops terraform saving the state. I'm 90% sure it's a problem in the lib,
but I could have done something wrong... YMMV so if any of you do have a
chance to test (with some kind of demo, or a copy of something existing,
not production of course!). 🙂
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9040 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABIcGzm_13b0FKD19tv_0G1M2L_Ph9Pks5rUF_CgaJpZM4KF-sR>
.
|
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; cloudflare#3.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; cloudflare#3.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; cloudflare#3.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; cloudflare#3.
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; #3. Require at least one page rule action Simplify page rule targets API Asking for a list of targets is just confusing to a user when Cloudflare only accepts a single `"url"` target. Implement action value validation Improve legibility Change action Elems to be Schema Implement Read/Update/Delete Page Rules Simplify Page Rule action schema This commit changes Page Rule actions to be a TypeSet of maps containing the action ID, and optionally its sub-setting. This makes validation a bit nicer, too. Fix crash while running apply Page Rule Read implementation was naïvely copying Cloudflare's returned data structure, rather than transforming to fit schema. Fix passing PageRuleAction value error back up Flatten PageRule action schema Fix flattened structure Unfortunately, we cannot have the desired structure with a `schema.Resource` `actions` in the main schema: resource "cloudflare_page_rule" "foo" { actions = { always_online = true } } where `always_online` and other Actions are explicitly defined, since `actions` needs to be a `schema.Schema`. This commit moves the `Resource` inside `actions`, which now becomes a `Schema` of `TypeSet`, which means Cloudflare's binary options such as `always_online` will default to `false` if we have them be `TypeBool`. To circumvent that, we instead use `TypeString` and validate `"on"` or `"off"` (matching Cloudflare's API) - since these will be empty if not set. The logic's a little less clean, since we now have to loop through every possible action type for each action in the set, testing the type and value of its sub-setting/mode to determine if it was really set by the user. Document page rule resources Appease linter Add acceptance tests for page rules Fix allowing multiple entries in page rule actions Improve error reporting get page rule resource working, add tests random fixes standardise on zone + implement import tests check api attributes + docs update for page rule error check on set complex attr + remove failing attributes from page rules tests
This commit adds most of the boilerplate for implementing CloudFlare Page Rules, and implements the Create method. `PageRuleActionValue`s still need a validator; this is complex and depends on `PageRuleActionId`. Read, Update, and Delete methods will throw 'not implemented' errors. Towards hashicorp/terraform#9040; #3. Require at least one page rule action Simplify page rule targets API Asking for a list of targets is just confusing to a user when Cloudflare only accepts a single `"url"` target. Implement action value validation Improve legibility Change action Elems to be Schema Implement Read/Update/Delete Page Rules Simplify Page Rule action schema This commit changes Page Rule actions to be a TypeSet of maps containing the action ID, and optionally its sub-setting. This makes validation a bit nicer, too. Fix crash while running apply Page Rule Read implementation was naïvely copying Cloudflare's returned data structure, rather than transforming to fit schema. Fix passing PageRuleAction value error back up Flatten PageRule action schema Fix flattened structure Unfortunately, we cannot have the desired structure with a `schema.Resource` `actions` in the main schema: resource "cloudflare_page_rule" "foo" { actions = { always_online = true } } where `always_online` and other Actions are explicitly defined, since `actions` needs to be a `schema.Schema`. This commit moves the `Resource` inside `actions`, which now becomes a `Schema` of `TypeSet`, which means Cloudflare's binary options such as `always_online` will default to `false` if we have them be `TypeBool`. To circumvent that, we instead use `TypeString` and validate `"on"` or `"off"` (matching Cloudflare's API) - since these will be empty if not set. The logic's a little less clean, since we now have to loop through every possible action type for each action in the set, testing the type and value of its sub-setting/mode to determine if it was really set by the user. Document page rule resources Appease linter Add acceptance tests for page rules Fix allowing multiple entries in page rule actions Improve error reporting get page rule resource working, add tests random fixes standardise on zone + implement import tests check api attributes + docs update for page rule error check on set complex attr + remove failing attributes from page rules tests
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This is not a bug report but rather a feature request. The cloudflare API currently supports only the "Record" resource. The GO API Library has many other features, though.
https://godoc.org/github.com/cloudflare/cloudflare-go
Any chances of getting some of these into the Cloudflare Provider?
The text was updated successfully, but these errors were encountered: