1. Packages
  2. Cloudflare
  3. API Docs
  4. PageRule
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

cloudflare.PageRule

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

    Provides a Cloudflare page rule resource.

    Example Usage

    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",
            }],
        },
    });
    
    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",
            )],
        ))
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Add a page rule to the domain
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("sub.%v/page", _var.Cloudflare_zone)),
    			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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Add a page rule to the domain
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"sub.{@var.Cloudflare_zone}/page",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                Ssl = "flexible",
                EmailObfuscation = "on",
                Minifies = new[]
                {
                    new Cloudflare.Inputs.PageRuleActionsMinifyArgs
                    {
                        Html = "off",
                        Css = "on",
                        Js = "on",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("sub.%s/page", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .ssl("flexible")
                    .emailObfuscation("on")
                    .minifies(PageRuleActionsMinifyArgs.builder()
                        .html("off")
                        .css("on")
                        .js("on")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Add a page rule to the domain
      foobar:
        type: cloudflare:PageRule
        properties:
          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 PageRule Resource

    new PageRule(name: string, args: PageRuleArgs, opts?: CustomResourceOptions);
    @overload
    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)
    @overload
    def PageRule(resource_name: str,
                 args: PageRuleArgs,
                 opts: Optional[ResourceOptions] = None)
    func NewPageRule(ctx *Context, name string, args PageRuleArgs, opts ...ResourceOption) (*PageRule, error)
    public PageRule(string name, PageRuleArgs args, CustomResourceOptions? opts = null)
    public PageRule(String name, PageRuleArgs args)
    public PageRule(String name, PageRuleArgs args, CustomResourceOptions options)
    
    type: cloudflare:PageRule
    properties: # The arguments to resource properties.
    options: # 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.
    resource_name str
    The unique name of the resource.
    args PageRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control 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.
    name String
    The unique name of the resource.
    args PageRuleArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts docs.

    Inputs

    The PageRule resource accepts the following input properties:

    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 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 Integer
    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.
    actions Property Map
    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.

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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)
    public static PageRule get(String name, Output<String> id, PageRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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 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 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 Integer
    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.
    actions Property Map
    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.

    Supporting Types

    PageRuleActions, PageRuleActionsArgs

    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 List<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.
    DisableZaraz 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 List<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".
    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.
    DisableZaraz 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".
    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 List<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.
    disableZaraz Boolean
    Boolean of whether this action is enabled. Default: false.
    edgeCacheTtl Integer
    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 List<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".
    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.
    disableZaraz 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_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 PageRuleActionsCacheKeyFields
    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[PageRuleActionsCacheTtlByStatus]
    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.
    disable_zaraz 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 PageRuleActionsForwardingUrl
    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[PageRuleActionsMinify]
    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".
    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 Property Map
    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<Property Map>
    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.
    disableZaraz 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 Property Map
    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<Property Map>
    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".

    PageRuleActionsCacheKeyFields, PageRuleActionsCacheKeyFieldsArgs

    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 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 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:
    query_string 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 Property Map
    Controls which Host header goes into Cache Key:
    queryString Property Map
    Controls which URL query string parameters go into the Cache Key.
    user Property Map
    Controls which end user-related features go into the Cache Key.
    cookie Property Map
    Controls what cookies go into Cache Key:
    header Property Map
    Controls what HTTP headers go into Cache Key:

    PageRuleActionsCacheKeyFieldsCookie, PageRuleActionsCacheKeyFieldsCookieArgs

    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 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.
    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.
    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.

    PageRuleActionsCacheKeyFieldsHeader, PageRuleActionsCacheKeyFieldsHeaderArgs

    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 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.
    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.
    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.

    PageRuleActionsCacheKeyFieldsHost, PageRuleActionsCacheKeyFieldsHostArgs

    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 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).
    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).

    PageRuleActionsCacheKeyFieldsQueryString, PageRuleActionsCacheKeyFieldsQueryStringArgs

    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 should be false 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 should be false if any of exclude or include is non-empty.
    Includes []string
    Only use values of specified query string parameters in Cache Key.
    excludes List<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 should be false 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 boolean
    false (default) - all query string parameters are used for Cache Key, unless explicitly excluded; true - all query string parameters are ignored; value should be false 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 should be false if any of exclude or include is non-empty.
    includes Sequence[str]
    Only use values of specified query string parameters in Cache Key.
    excludes List<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 should be false if any of exclude or include is non-empty.
    includes List<String>
    Only use values of specified query string parameters in Cache Key.

    PageRuleActionsCacheKeyFieldsUser, PageRuleActionsCacheKeyFieldsUserArgs

    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    
    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    
    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    
    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    
    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    
    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.

    Example:

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    

    // Unrealistic example with all features used const foobar = new cloudflare.PageRule("foobar", { zoneId: _var.cloudflare_zone_id, target: ${_var.cloudflare_zone}/app/*, priority: 1, actions: { cacheKeyFields: { cookie: { checkPresences: ["wordpress_test_cookie"], }, header: { checkPresences: ["header_present"], excludes: ["origin"], includes: [ "api-key", "dnt", ], }, host: { resolved: true, }, queryString: { ignore: true, }, user: { deviceType: false, geo: true, lang: true, }, }, }, });

    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # Unrealistic example with all features used
    foobar = cloudflare.PageRule("foobar",
        zone_id=var["cloudflare_zone_id"],
        target=f"{var['cloudflare_zone']}/app/*",
        priority=1,
        actions=cloudflare.PageRuleActionsArgs(
            cache_key_fields=cloudflare.PageRuleActionsCacheKeyFieldsArgs(
                cookie=cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs(
                    check_presences=["wordpress_test_cookie"],
                ),
                header=cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs(
                    check_presences=["header_present"],
                    excludes=["origin"],
                    includes=[
                        "api-key",
                        "dnt",
                    ],
                ),
                host=cloudflare.PageRuleActionsCacheKeyFieldsHostArgs(
                    resolved=True,
                ),
                query_string=cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs(
                    ignore=True,
                ),
                user=cloudflare.PageRuleActionsCacheKeyFieldsUserArgs(
                    device_type=False,
                    geo=True,
                    lang=True,
                ),
            ),
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // Unrealistic example with all features used
        var foobar = new Cloudflare.PageRule("foobar", new()
        {
            ZoneId = @var.Cloudflare_zone_id,
            Target = $"{@var.Cloudflare_zone}/app/*",
            Priority = 1,
            Actions = new Cloudflare.Inputs.PageRuleActionsArgs
            {
                CacheKeyFields = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsArgs
                {
                    Cookie = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsCookieArgs
                    {
                        CheckPresences = new[]
                        {
                            "wordpress_test_cookie",
                        },
                    },
                    Header = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHeaderArgs
                    {
                        CheckPresences = new[]
                        {
                            "header_present",
                        },
                        Excludes = new[]
                        {
                            "origin",
                        },
                        Includes = new[]
                        {
                            "api-key",
                            "dnt",
                        },
                    },
                    Host = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsHostArgs
                    {
                        Resolved = true,
                    },
                    QueryString = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs
                    {
                        Ignore = true,
                    },
                    User = new Cloudflare.Inputs.PageRuleActionsCacheKeyFieldsUserArgs
                    {
                        DeviceType = false,
                        Geo = true,
                        Lang = true,
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Unrealistic example with all features used
    		_, err := cloudflare.NewPageRule(ctx, "foobar", &cloudflare.PageRuleArgs{
    			ZoneId:   pulumi.Any(_var.Cloudflare_zone_id),
    			Target:   pulumi.String(fmt.Sprintf("%v/app/*", _var.Cloudflare_zone)),
    			Priority: pulumi.Int(1),
    			Actions: &cloudflare.PageRuleActionsArgs{
    				CacheKeyFields: &cloudflare.PageRuleActionsCacheKeyFieldsArgs{
    					Cookie: &cloudflare.PageRuleActionsCacheKeyFieldsCookieArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("wordpress_test_cookie"),
    						},
    					},
    					Header: &cloudflare.PageRuleActionsCacheKeyFieldsHeaderArgs{
    						CheckPresences: pulumi.StringArray{
    							pulumi.String("header_present"),
    						},
    						Excludes: pulumi.StringArray{
    							pulumi.String("origin"),
    						},
    						Includes: pulumi.StringArray{
    							pulumi.String("api-key"),
    							pulumi.String("dnt"),
    						},
    					},
    					Host: &cloudflare.PageRuleActionsCacheKeyFieldsHostArgs{
    						Resolved: pulumi.Bool(true),
    					},
    					QueryString: &cloudflare.PageRuleActionsCacheKeyFieldsQueryStringArgs{
    						Ignore: pulumi.Bool(true),
    					},
    					User: &cloudflare.PageRuleActionsCacheKeyFieldsUserArgs{
    						DeviceType: pulumi.Bool(false),
    						Geo:        pulumi.Bool(true),
    						Lang:       pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.PageRule;
    import com.pulumi.cloudflare.PageRuleArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsCookieArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHeaderArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsHostArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsQueryStringArgs;
    import com.pulumi.cloudflare.inputs.PageRuleActionsCacheKeyFieldsUserArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var foobar = new PageRule("foobar", PageRuleArgs.builder()        
                .zoneId(var_.cloudflare_zone_id())
                .target(String.format("%s/app/*", var_.cloudflare_zone()))
                .priority(1)
                .actions(PageRuleActionsArgs.builder()
                    .cacheKeyFields(PageRuleActionsCacheKeyFieldsArgs.builder()
                        .cookie(PageRuleActionsCacheKeyFieldsCookieArgs.builder()
                            .checkPresences("wordpress_test_cookie")
                            .build())
                        .header(PageRuleActionsCacheKeyFieldsHeaderArgs.builder()
                            .checkPresences("header_present")
                            .excludes("origin")
                            .includes(                        
                                "api-key",
                                "dnt")
                            .build())
                        .host(PageRuleActionsCacheKeyFieldsHostArgs.builder()
                            .resolved(true)
                            .build())
                        .queryString(PageRuleActionsCacheKeyFieldsQueryStringArgs.builder()
                            .ignore(true)
                            .build())
                        .user(PageRuleActionsCacheKeyFieldsUserArgs.builder()
                            .deviceType(false)
                            .geo(true)
                            .lang(true)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Unrealistic example with all features used
      foobar:
        type: cloudflare:PageRule
        properties:
          zoneId: ${var.cloudflare_zone_id}
          target: ${var.cloudflare_zone}/app/*
          priority: 1
          actions:
            cacheKeyFields:
              cookie:
                checkPresences:
                  - wordpress_test_cookie
              header:
                checkPresences:
                  - header_present
                excludes:
                  - origin
                includes:
                  - api-key
                  - dnt
              host:
                resolved: true
              queryString:
                ignore: true
              user:
                deviceType: false
                geo: true
                lang: true
    

    PageRuleActionsCacheTtlByStatus, PageRuleActionsCacheTtlByStatusArgs

    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 Integer
    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
    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

    PageRuleActionsForwardingUrl, PageRuleActionsForwardingUrlArgs

    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 Integer
    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.
    statusCode Number
    The status code to use for the redirection.
    url String
    The URL to which the page rule should forward.

    PageRuleActionsMinify, PageRuleActionsMinifyArgs

    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 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".
    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".

    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
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi