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

add resolve_override page_rule action #2

Merged
merged 1 commit into from
May 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cloudflare/resource_cloudflare_page_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ func resourceCloudFlarePageRule() *schema.Resource {
},
},

// should really validate if FQDN is resolveable, non-empty and < domain length limit will have to do
"resolve_override": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringLenBetween(1, 255),
},

// may not be used with disable_performance
"rocket_loader": {
Type: schema.TypeString,
Expand Down Expand Up @@ -398,7 +405,7 @@ func resourceCloudFlarePageRuleDelete(d *schema.ResourceData, meta interface{})
var pageRuleAPIOnOffFields = []string{"always_online", "automatic_https_rewrites", "browser_check", "email_obfuscation", "ip_geolocation", "opportunistic_encryption", "server_side_exclude", "smart_errors"}
var pageRuleAPINilFields = []string{"always_use_https", "disable_apps", "disable_performance", "disable_security"}
var pageRuleAPIFloatFields = []string{"browser_cache_ttl", "edge_cache_ttl"}
var pageRuleAPIStringFields = []string{"cache_level", "rocket_loader", "security_level", "ssl"}
var pageRuleAPIStringFields = []string{"cache_level", "resolve_override", rocket_loader", "security_level", "ssl"}

func transformFromCloudFlarePageRuleAction(pageRuleAction *cloudflare.PageRuleAction) (key string, value interface{}, err error) {
key = pageRuleAction.ID
Expand Down