Skip to content
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 #3

Closed
hashibot opened this issue Jun 13, 2017 · 11 comments
Closed

Cloudflare API Support #3

hashibot opened this issue Jun 13, 2017 · 11 comments
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.

Comments

@hashibot
Copy link

This issue was originally opened by @omarabid as hashicorp/terraform#9040. It was migrated here as part of the provider split. The original body of the issue is below.


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?

@hashibot hashibot added the kind/enhancement Categorizes issue or PR as related to improving an existing feature. label Jun 13, 2017
@jamestyrrell
Copy link

+1, page rules would be awesome.

@OJFord
Copy link
Contributor

OJFord commented Jun 14, 2017

Re-linking hashicorp/terraform#11249 - PR for page rules. I suppose it needs rebasing here, and it's still missing tests. It's a bit stale, but I haven't forgotten it 🙂

OJFord added a commit to OJFord/terraform-provider-cloudflare that referenced this issue Jul 5, 2017
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.
OJFord added a commit to OJFord/terraform-provider-cloudflare that referenced this issue Jul 5, 2017
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.
@thomasbiddle
Copy link

Would love to see support for:

  • Setting SSL Setting (Full / Flexible / etc.)
  • Always Use HTTPS (Redirect http to https)
  • Automatic HTTPS Rewrites (Automatically fixes any content referencing http to https if it is supported)

@OJFord
Copy link
Contributor

OJFord commented Jul 11, 2017

@thomasbiddle These are all supported as page rule actions in my PR - are they also possible in the CF web app as a zone/domain-wide setting?

@elithrar
Copy link

elithrar commented Jul 11, 2017 via email

@elaijuh
Copy link

elaijuh commented Aug 9, 2017

+1 for load balancer

@elithrar
Copy link

elithrar commented Aug 9, 2017

@elaijuh We've added support for Load Balancing to the cloudflare-go library in the latest release - https://github.com/cloudflare/cloudflare-go/releases/tag/v0.8.0 - this should make contributing LB management to the Cloudflare Terraform provider much easier now!

@Asara
Copy link

Asara commented Feb 1, 2018

Would love more support for cloudflare via terraform!

@wingZero21
Copy link

Hi,

It would be good if these additional features could be ported into the cloudflare terraform provider including the LB management.

benjvi pushed a commit to benjvi/terraform-provider-cloudflare that referenced this issue Mar 1, 2018
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.
benjvi pushed a commit to benjvi/terraform-provider-cloudflare that referenced this issue Mar 5, 2018
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.
catsby pushed a commit that referenced this issue Mar 12, 2018
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
catsby added a commit that referenced this issue Mar 12, 2018
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
simpsora pushed a commit to simpsora/terraform-provider-cloudflare that referenced this issue Jun 20, 2018
…le-resolve_override

add doc for resolve_override
@garrettgalow
Copy link
Contributor

@patryk this isn't a specific issue and has just been a catch all for feature requests, most of which are tracked separately now as they should be. Also most of them have been added by this point.

We should just close this one.

@patryk
Copy link
Contributor

patryk commented Aug 14, 2018

Yep, you're right. Tracked in separate issues already. Closing this one.

@patryk patryk closed this as completed Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature.
Projects
None yet
Development

No branches or pull requests

10 participants