Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

PageRule

Provides a Cloudflare page rule resource.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        // Add a page rule to the domain
        var foobar = new Cloudflare.PageRule("foobar", new Cloudflare.PageRuleArgs
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"sub.{@var.Cloudflare_zone}/page",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                Ssl = "flexible",
                EmailObfuscation = "on",
                Minifies = 
                {
                    new Cloudflare.Inputs.PageRuleActionsMinifyArgs
                    {
                        Html = "off",
                        Css = "on",
                        Js = "on",
                    },
                },
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-cloudflare/sdk/v2/go/cloudflare"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
            ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
            Target:   pulumi.String(fmt.Sprintf("%v%v%v", "sub.", _var.Cloudflare_zone, "/page")),
            Priority: pulumi.Int(1),
            Actions: &cloudflare.PageRuleActionsArgs{
                Ssl:              pulumi.String("flexible"),
                EmailObfuscation: pulumi.String("on"),
                Minifies: cloudflare.PageRuleActionsMinifyArray{
                    &cloudflare.PageRuleActionsMinifyArgs{
                        Html: pulumi.String("off"),
                        Css:  pulumi.String("on"),
                        Js:   pulumi.String("on"),
                    },
                },
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudflare as cloudflare

# Add a page rule to the domain
foobar = cloudflare.PageRule("foobar",
    zone_id=var["cloudflare_zone_id"],
    target=f"sub.{var['cloudflare_zone']}/page",
    priority=1,
    actions=cloudflare.PageRuleActionsArgs(
        ssl="flexible",
        email_obfuscation="on",
        minifies=[cloudflare.PageRuleActionsMinifyArgs(
            html="off",
            css="on",
            js="on",
        )],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

// Add a page rule to the domain
const foobar = new cloudflare.PageRule("foobar", {
    zoneId: _var.cloudflare_zone_id,
    target: `sub.${_var.cloudflare_zone}/page`,
    priority: 1,
    actions: {
        ssl: "flexible",
        emailObfuscation: "on",
        minifies: [{
            html: "off",
            css: "on",
            js: "on",
        }],
    },
});

Create a PageRule Resource

new PageRule(name: string, args: PageRuleArgs, opts?: CustomResourceOptions);
def PageRule(resource_name: str, opts: Optional[ResourceOptions] = None, actions: Optional[PageRuleActionsArgs] = None, priority: Optional[int] = None, status: Optional[str] = None, target: Optional[str] = None, zone_id: Optional[str] = None)
func NewPageRule(ctx *Context, name string, args PageRuleArgs, opts ...ResourceOption) (*PageRule, error)
public PageRule(string name, PageRuleArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PageRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PageRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PageRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

PageRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The PageRule resource accepts the following input properties:

Actions PageRuleActionsArgs

The actions taken by the page rule, options given below.

Target string

The URL pattern to target with the page rule.

ZoneId string

The DNS zone ID to which the page rule should be added.

Priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

Status string

Whether the page rule is active or disabled.

Actions PageRuleActions

The actions taken by the page rule, options given below.

Target string

The URL pattern to target with the page rule.

ZoneId string

The DNS zone ID to which the page rule should be added.

Priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

Status string

Whether the page rule is active or disabled.

actions PageRuleActions

The actions taken by the page rule, options given below.

target string

The URL pattern to target with the page rule.

zoneId string

The DNS zone ID to which the page rule should be added.

priority number

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

status string

Whether the page rule is active or disabled.

actions PageRuleActionsArgs

The actions taken by the page rule, options given below.

target str

The URL pattern to target with the page rule.

zone_id str

The DNS zone ID to which the page rule should be added.

priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

status str

Whether the page rule is active or disabled.

Outputs

All input properties are implicitly available as output properties. Additionally, the PageRule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing PageRule Resource

Get an existing PageRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PageRuleState, opts?: CustomResourceOptions): PageRule
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, actions: Optional[PageRuleActionsArgs] = None, priority: Optional[int] = None, status: Optional[str] = None, target: Optional[str] = None, zone_id: Optional[str] = None) -> PageRule
func GetPageRule(ctx *Context, name string, id IDInput, state *PageRuleState, opts ...ResourceOption) (*PageRule, error)
public static PageRule Get(string name, Input<string> id, PageRuleState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Actions PageRuleActionsArgs

The actions taken by the page rule, options given below.

Priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

Status string

Whether the page rule is active or disabled.

Target string

The URL pattern to target with the page rule.

ZoneId string

The DNS zone ID to which the page rule should be added.

Actions PageRuleActions

The actions taken by the page rule, options given below.

Priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

Status string

Whether the page rule is active or disabled.

Target string

The URL pattern to target with the page rule.

ZoneId string

The DNS zone ID to which the page rule should be added.

actions PageRuleActions

The actions taken by the page rule, options given below.

priority number

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

status string

Whether the page rule is active or disabled.

target string

The URL pattern to target with the page rule.

zoneId string

The DNS zone ID to which the page rule should be added.

actions PageRuleActionsArgs

The actions taken by the page rule, options given below.

priority int

The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.

status str

Whether the page rule is active or disabled.

target str

The URL pattern to target with the page rule.

zone_id str

The DNS zone ID to which the page rule should be added.

Supporting Types

PageRuleActions

AlwaysOnline string

Whether this action is "on" or "off".

AlwaysUseHttps bool

Boolean of whether this action is enabled. Default: false.

AutomaticHttpsRewrites string

Whether this action is "on" or "off".

BrowserCacheTtl string

The Time To Live for the browser cache. 0 means ‘Respect Existing Headers’

BrowserCheck string

Whether this action is "on" or "off".

BypassCacheOnCookie string

String value of cookie name to conditionally bypass cache the page.

CacheByDeviceType string

Whether this action is "on" or "off".

CacheDeceptionArmor string

Whether this action is "on" or "off".

CacheKeyFields PageRuleActionsCacheKeyFieldsArgs

Controls how Cloudflare creates Cache Keys used to identify files in cache. See below for full description.

CacheLevel string

Whether to set the cache level to "bypass", "basic", "simplified", "aggressive", or "cache_everything".

CacheOnCookie string

String value of cookie name to conditionally cache the page.

CacheTtlByStatuses List<PageRuleActionsCacheTtlByStatusArgs>

Set cache TTL based on the response status from the origin web server. Can be specified multiple times. See below for full description.

DisableApps bool

Boolean of whether this action is enabled. Default: false.

DisablePerformance bool

Boolean of whether this action is enabled. Default: false.

DisableRailgun bool

Boolean of whether this action is enabled. Default: false.

DisableSecurity bool

Boolean of whether this action is enabled. Default: false.

EdgeCacheTtl int

The Time To Live for the edge cache.

EmailObfuscation string

Whether this action is "on" or "off".

ExplicitCacheControl string

Whether origin Cache-Control action is "on" or "off".

ForwardingUrl PageRuleActionsForwardingUrlArgs

The URL to forward to, and with what status. See below.

HostHeaderOverride string

Value of the Host header to send.

IpGeolocation string

Whether this action is "on" or "off".

Minifies List<PageRuleActionsMinifyArgs>

The configuration for HTML, CSS and JS minification. See below for full list of options.

Mirage string

Whether this action is "on" or "off".

OpportunisticEncryption string

Whether this action is "on" or "off".

OriginErrorPagePassThru string

Whether this action is "on" or "off".

Polish string

Whether this action is "off", "lossless" or "lossy".

ResolveOverride string

Overridden origin server name.

RespectStrongEtag string

Whether this action is "on" or "off".

ResponseBuffering string

Whether this action is "on" or "off".

RocketLoader string

Whether to set the rocket loader to "on", "off".

SecurityLevel string

Whether to set the security level to "off", "essentially_off", "low", "medium", "high", or "under_attack".

ServerSideExclude string

Whether this action is "on" or "off".

SortQueryStringForCache string

Whether this action is "on" or "off".

Ssl string

Whether to set the SSL mode to "off", "flexible", "full", "strict", or "origin_pull".

TrueClientIpHeader string

Whether this action is "on" or "off".

Waf string

Whether this action is "on" or "off".

AlwaysOnline string

Whether this action is "on" or "off".

AlwaysUseHttps bool

Boolean of whether this action is enabled. Default: false.

AutomaticHttpsRewrites string

Whether this action is "on" or "off".

BrowserCacheTtl string

The Time To Live for the browser cache. 0 means ‘Respect Existing Headers’

BrowserCheck string

Whether this action is "on" or "off".

BypassCacheOnCookie string

String value of cookie name to conditionally bypass cache the page.

CacheByDeviceType string

Whether this action is "on" or "off".

CacheDeceptionArmor string

Whether this action is "on" or "off".

CacheKeyFields PageRuleActionsCacheKeyFields

Controls how Cloudflare creates Cache Keys used to identify files in cache. See below for full description.

CacheLevel string

Whether to set the cache level to "bypass", "basic", "simplified", "aggressive", or "cache_everything".

CacheOnCookie string

String value of cookie name to conditionally cache the page.

CacheTtlByStatuses []PageRuleActionsCacheTtlByStatus

Set cache TTL based on the response status from the origin web server. Can be specified multiple times. See below for full description.

DisableApps bool

Boolean of whether this action is enabled. Default: false.

DisablePerformance bool

Boolean of whether this action is enabled. Default: false.

DisableRailgun bool

Boolean of whether this action is enabled. Default: false.

DisableSecurity bool

Boolean of whether this action is enabled. Default: false.

EdgeCacheTtl int

The Time To Live for the edge cache.

EmailObfuscation string

Whether this action is "on" or "off".

ExplicitCacheControl string

Whether origin Cache-Control action is "on" or "off".

ForwardingUrl PageRuleActionsForwardingUrl

The URL to forward to, and with what status. See below.

HostHeaderOverride string

Value of the Host header to send.

IpGeolocation string

Whether this action is "on" or "off".

Minifies []PageRuleActionsMinify

The configuration for HTML, CSS and JS minification. See below for full list of options.

Mirage string

Whether this action is "on" or "off".

OpportunisticEncryption string

Whether this action is "on" or "off".

OriginErrorPagePassThru string

Whether this action is "on" or "off".

Polish string

Whether this action is "off", "lossless" or "lossy".

ResolveOverride string

Overridden origin server name.

RespectStrongEtag string

Whether this action is "on" or "off".

ResponseBuffering string

Whether this action is "on" or "off".

RocketLoader string

Whether to set the rocket loader to "on", "off".

SecurityLevel string

Whether to set the security level to "off", "essentially_off", "low", "medium", "high", or "under_attack".

ServerSideExclude string

Whether this action is "on" or "off".

SortQueryStringForCache string

Whether this action is "on" or "off".

Ssl string

Whether to set the SSL mode to "off", "flexible", "full", "strict", or "origin_pull".

TrueClientIpHeader string

Whether this action is "on" or "off".

Waf string

Whether this action is "on" or "off".

alwaysOnline string

Whether this action is "on" or "off".

alwaysUseHttps boolean

Boolean of whether this action is enabled. Default: false.

automaticHttpsRewrites string

Whether this action is "on" or "off".

browserCacheTtl string

The Time To Live for the browser cache. 0 means ‘Respect Existing Headers’

browserCheck string

Whether this action is "on" or "off".

bypassCacheOnCookie string

String value of cookie name to conditionally bypass cache the page.

cacheByDeviceType string

Whether this action is "on" or "off".

cacheDeceptionArmor string

Whether this action is "on" or "off".

cacheKeyFields PageRuleActionsCacheKeyFields

Controls how Cloudflare creates Cache Keys used to identify files in cache. See below for full description.

cacheLevel string

Whether to set the cache level to "bypass", "basic", "simplified", "aggressive", or "cache_everything".

cacheOnCookie string

String value of cookie name to conditionally cache the page.

cacheTtlByStatuses PageRuleActionsCacheTtlByStatus[]

Set cache TTL based on the response status from the origin web server. Can be specified multiple times. See below for full description.

disableApps boolean

Boolean of whether this action is enabled. Default: false.

disablePerformance boolean

Boolean of whether this action is enabled. Default: false.

disableRailgun boolean

Boolean of whether this action is enabled. Default: false.

disableSecurity boolean

Boolean of whether this action is enabled. Default: false.

edgeCacheTtl number

The Time To Live for the edge cache.

emailObfuscation string

Whether this action is "on" or "off".

explicitCacheControl string

Whether origin Cache-Control action is "on" or "off".

forwardingUrl PageRuleActionsForwardingUrl

The URL to forward to, and with what status. See below.

hostHeaderOverride string

Value of the Host header to send.

ipGeolocation string

Whether this action is "on" or "off".

minifies PageRuleActionsMinify[]

The configuration for HTML, CSS and JS minification. See below for full list of options.

mirage string

Whether this action is "on" or "off".

opportunisticEncryption string

Whether this action is "on" or "off".

originErrorPagePassThru string

Whether this action is "on" or "off".

polish string

Whether this action is "off", "lossless" or "lossy".

resolveOverride string

Overridden origin server name.

respectStrongEtag string

Whether this action is "on" or "off".

responseBuffering string

Whether this action is "on" or "off".

rocketLoader string

Whether to set the rocket loader to "on", "off".

securityLevel string

Whether to set the security level to "off", "essentially_off", "low", "medium", "high", or "under_attack".

serverSideExclude string

Whether this action is "on" or "off".

sortQueryStringForCache string

Whether this action is "on" or "off".

ssl string

Whether to set the SSL mode to "off", "flexible", "full", "strict", or "origin_pull".

trueClientIpHeader string

Whether this action is "on" or "off".

waf string

Whether this action is "on" or "off".

always_online str

Whether this action is "on" or "off".

always_use_https bool

Boolean of whether this action is enabled. Default: false.

automatic_https_rewrites str

Whether this action is "on" or "off".

browser_cache_ttl str

The Time To Live for the browser cache. 0 means ‘Respect Existing Headers’

browser_check str

Whether this action is "on" or "off".

bypass_cache_on_cookie str

String value of cookie name to conditionally bypass cache the page.

cache_by_device_type str

Whether this action is "on" or "off".

cache_deception_armor str

Whether this action is "on" or "off".

cache_key_fields PageRuleActionsCacheKeyFieldsArgs

Controls how Cloudflare creates Cache Keys used to identify files in cache. See below for full description.

cache_level str

Whether to set the cache level to "bypass", "basic", "simplified", "aggressive", or "cache_everything".

cache_on_cookie str

String value of cookie name to conditionally cache the page.

cache_ttl_by_statuses Sequence[PageRuleActionsCacheTtlByStatusArgs]

Set cache TTL based on the response status from the origin web server. Can be specified multiple times. See below for full description.

disable_apps bool

Boolean of whether this action is enabled. Default: false.

disable_performance bool

Boolean of whether this action is enabled. Default: false.

disable_railgun bool

Boolean of whether this action is enabled. Default: false.

disable_security bool

Boolean of whether this action is enabled. Default: false.

edge_cache_ttl int

The Time To Live for the edge cache.

email_obfuscation str

Whether this action is "on" or "off".

explicit_cache_control str

Whether origin Cache-Control action is "on" or "off".

forwarding_url PageRuleActionsForwardingUrlArgs

The URL to forward to, and with what status. See below.

host_header_override str

Value of the Host header to send.

ip_geolocation str

Whether this action is "on" or "off".

minifies Sequence[PageRuleActionsMinifyArgs]

The configuration for HTML, CSS and JS minification. See below for full list of options.

mirage str

Whether this action is "on" or "off".

opportunistic_encryption str

Whether this action is "on" or "off".

origin_error_page_pass_thru str

Whether this action is "on" or "off".

polish str

Whether this action is "off", "lossless" or "lossy".

resolve_override str

Overridden origin server name.

respect_strong_etag str

Whether this action is "on" or "off".

response_buffering str

Whether this action is "on" or "off".

rocket_loader str

Whether to set the rocket loader to "on", "off".

security_level str

Whether to set the security level to "off", "essentially_off", "low", "medium", "high", or "under_attack".

server_side_exclude str

Whether this action is "on" or "off".

sort_query_string_for_cache str

Whether this action is "on" or "off".

ssl str

Whether to set the SSL mode to "off", "flexible", "full", "strict", or "origin_pull".

true_client_ip_header str

Whether this action is "on" or "off".

waf str

Whether this action is "on" or "off".

PageRuleActionsCacheKeyFields

Cookie PageRuleActionsCacheKeyFieldsCookieArgs

Controls what cookies go into Cache Key:

Header PageRuleActionsCacheKeyFieldsHeaderArgs

Controls what HTTP headers go into Cache Key:

Host PageRuleActionsCacheKeyFieldsHostArgs

Controls which Host header goes into Cache Key:

QueryString PageRuleActionsCacheKeyFieldsQueryStringArgs

Controls which URL query string parameters go into the Cache Key.

User PageRuleActionsCacheKeyFieldsUserArgs

Controls which end user-related features go into the Cache Key.

Cookie PageRuleActionsCacheKeyFieldsCookie

Controls what cookies go into Cache Key:

Header PageRuleActionsCacheKeyFieldsHeader

Controls what HTTP headers go into Cache Key:

Host PageRuleActionsCacheKeyFieldsHost

Controls which Host header goes into Cache Key:

QueryString PageRuleActionsCacheKeyFieldsQueryString

Controls which URL query string parameters go into the Cache Key.

User PageRuleActionsCacheKeyFieldsUser

Controls which end user-related features go into the Cache Key.

cookie PageRuleActionsCacheKeyFieldsCookie

Controls what cookies go into Cache Key:

header PageRuleActionsCacheKeyFieldsHeader

Controls what HTTP headers go into Cache Key:

host PageRuleActionsCacheKeyFieldsHost

Controls which Host header goes into Cache Key:

queryString PageRuleActionsCacheKeyFieldsQueryString

Controls which URL query string parameters go into the Cache Key.

user PageRuleActionsCacheKeyFieldsUser

Controls which end user-related features go into the Cache Key.

cookie PageRuleActionsCacheKeyFieldsCookieArgs

Controls what cookies go into Cache Key:

header PageRuleActionsCacheKeyFieldsHeaderArgs

Controls what HTTP headers go into Cache Key:

host PageRuleActionsCacheKeyFieldsHostArgs

Controls which Host header goes into Cache Key:

query_string PageRuleActionsCacheKeyFieldsQueryStringArgs

Controls which URL query string parameters go into the Cache Key.

user PageRuleActionsCacheKeyFieldsUserArgs

Controls which end user-related features go into the Cache Key.

PageRuleActionsCacheKeyFieldsCookie

CheckPresences List<string>

Check for presence of specified HTTP headers, without including their actual values.

Includes List<string>

Only use values of specified query string parameters in Cache Key.

CheckPresences []string

Check for presence of specified HTTP headers, without including their actual values.

Includes []string

Only use values of specified query string parameters in Cache Key.

checkPresences string[]

Check for presence of specified HTTP headers, without including their actual values.

includes string[]

Only use values of specified query string parameters in Cache Key.

check_presences Sequence[str]

Check for presence of specified HTTP headers, without including their actual values.

includes Sequence[str]

Only use values of specified query string parameters in Cache Key.

PageRuleActionsCacheKeyFieldsHeader

CheckPresences List<string>

Check for presence of specified HTTP headers, without including their actual values.

Excludes List<string>

Exclude these query string parameters from Cache Key.

Includes List<string>

Only use values of specified query string parameters in Cache Key.

CheckPresences []string

Check for presence of specified HTTP headers, without including their actual values.

Excludes []string

Exclude these query string parameters from Cache Key.

Includes []string

Only use values of specified query string parameters in Cache Key.

checkPresences string[]

Check for presence of specified HTTP headers, without including their actual values.

excludes string[]

Exclude these query string parameters from Cache Key.

includes string[]

Only use values of specified query string parameters in Cache Key.

check_presences Sequence[str]

Check for presence of specified HTTP headers, without including their actual values.

excludes Sequence[str]

Exclude these query string parameters from Cache Key.

includes Sequence[str]

Only use values of specified query string parameters in Cache Key.

PageRuleActionsCacheKeyFieldsHost

Resolved bool

false (default) - includes the Host header in the HTTP request sent to the origin; true - includes the Host header that was resolved to get the origin IP for the request (e.g. changed with Resolve Override Page Rule).

Resolved bool

false (default) - includes the Host header in the HTTP request sent to the origin; true - includes the Host header that was resolved to get the origin IP for the request (e.g. changed with Resolve Override Page Rule).

resolved boolean

false (default) - includes the Host header in the HTTP request sent to the origin; true - includes the Host header that was resolved to get the origin IP for the request (e.g. changed with Resolve Override Page Rule).

resolved bool

false (default) - includes the Host header in the HTTP request sent to the origin; true - includes the Host header that was resolved to get the origin IP for the request (e.g. changed with Resolve Override Page Rule).

PageRuleActionsCacheKeyFieldsQueryString

Excludes List<string>

Exclude these query string parameters from Cache Key.

Ignore bool

false (default) - all query string parameters are used for Cache Key, unless explicitly excluded; true - all query string parameters are ignored; value is ignored if any of exclude or include is non-empty.

Includes List<string>

Only use values of specified query string parameters in Cache Key.

Excludes []string

Exclude these query string parameters from Cache Key.

Ignore bool

false (default) - all query string parameters are used for Cache Key, unless explicitly excluded; true - all query string parameters are ignored; value is ignored if any of exclude or include is non-empty.

Includes []string

Only use values of specified query string parameters in Cache Key.

excludes string[]

Exclude these query string parameters from Cache Key.

ignore boolean

false (default) - all query string parameters are used for Cache Key, unless explicitly excluded; true - all query string parameters are ignored; value is ignored if any of exclude or include is non-empty.

includes string[]

Only use values of specified query string parameters in Cache Key.

excludes Sequence[str]

Exclude these query string parameters from Cache Key.

ignore bool

false (default) - all query string parameters are used for Cache Key, unless explicitly excluded; true - all query string parameters are ignored; value is ignored if any of exclude or include is non-empty.

includes Sequence[str]

Only use values of specified query string parameters in Cache Key.

PageRuleActionsCacheKeyFieldsUser

DeviceType bool

true - classifies a request as “mobile”, “desktop”, or “tablet” based on the User Agent; defaults to false.

Geo bool

true - includes the client’s country, derived from the IP address; defaults to false.

Lang bool

true - includes the first language code contained in the Accept-Language header sent by the client; defaults to false.

DeviceType bool

true - classifies a request as “mobile”, “desktop”, or “tablet” based on the User Agent; defaults to false.

Geo bool

true - includes the client’s country, derived from the IP address; defaults to false.

Lang bool

true - includes the first language code contained in the Accept-Language header sent by the client; defaults to false.

deviceType boolean

true - classifies a request as “mobile”, “desktop”, or “tablet” based on the User Agent; defaults to false.

geo boolean

true - includes the client’s country, derived from the IP address; defaults to false.

lang boolean

true - includes the first language code contained in the Accept-Language header sent by the client; defaults to false.

device_type bool

true - classifies a request as “mobile”, “desktop”, or “tablet” based on the User Agent; defaults to false.

geo bool

true - includes the client’s country, derived from the IP address; defaults to false.

lang bool

true - includes the first language code contained in the Accept-Language header sent by the client; defaults to false.

PageRuleActionsCacheTtlByStatus

Codes string

A HTTP code (e.g. 404) or range of codes (e.g. 400-499)

Ttl int

Duration a resource lives in the Cloudflare cache. * positive number - cache for specified duration in seconds

Codes string

A HTTP code (e.g. 404) or range of codes (e.g. 400-499)

Ttl int

Duration a resource lives in the Cloudflare cache. * positive number - cache for specified duration in seconds

codes string

A HTTP code (e.g. 404) or range of codes (e.g. 400-499)

ttl number

Duration a resource lives in the Cloudflare cache. * positive number - cache for specified duration in seconds

codes str

A HTTP code (e.g. 404) or range of codes (e.g. 400-499)

ttl int

Duration a resource lives in the Cloudflare cache. * positive number - cache for specified duration in seconds

PageRuleActionsForwardingUrl

StatusCode int

The status code to use for the redirection.

Url string

The URL to which the page rule should forward.

StatusCode int

The status code to use for the redirection.

Url string

The URL to which the page rule should forward.

statusCode number

The status code to use for the redirection.

url string

The URL to which the page rule should forward.

status_code int

The status code to use for the redirection.

url str

The URL to which the page rule should forward.

PageRuleActionsMinify

Css string

Whether CSS should be minified. Valid values are "on" or "off".

Html string

Whether HTML should be minified. Valid values are "on" or "off".

Js string

Whether Javascript should be minified. Valid values are "on" or "off".

Css string

Whether CSS should be minified. Valid values are "on" or "off".

Html string

Whether HTML should be minified. Valid values are "on" or "off".

Js string

Whether Javascript should be minified. Valid values are "on" or "off".

css string

Whether CSS should be minified. Valid values are "on" or "off".

html string

Whether HTML should be minified. Valid values are "on" or "off".

js string

Whether Javascript should be minified. Valid values are "on" or "off".

css str

Whether CSS should be minified. Valid values are "on" or "off".

html str

Whether HTML should be minified. Valid values are "on" or "off".

js str

Whether Javascript should be minified. Valid values are "on" or "off".

Import

Page rules can be imported using a composite ID formed of zone ID and page rule ID, e.g.

 $ pulumi import cloudflare:index/pageRule:PageRule default d41d8cd98f00b204e9800998ecf8427e/ch8374ftwdghsif43

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.