1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getPageRule
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getPageRule

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const examplePageRule = cloudflare.getPageRule({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        pageruleId: "023e105f4ecef8ad9ca31a8372d0c353",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_page_rule = cloudflare.get_page_rule(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        pagerule_id="023e105f4ecef8ad9ca31a8372d0c353")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupPageRule(ctx, &cloudflare.LookupPageRuleArgs{
    			ZoneId:     "023e105f4ecef8ad9ca31a8372d0c353",
    			PageruleId: "023e105f4ecef8ad9ca31a8372d0c353",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var examplePageRule = Cloudflare.GetPageRule.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            PageruleId = "023e105f4ecef8ad9ca31a8372d0c353",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetPageRuleArgs;
    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) {
            final var examplePageRule = CloudflareFunctions.getPageRule(GetPageRuleArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .pageruleId("023e105f4ecef8ad9ca31a8372d0c353")
                .build());
    
        }
    }
    
    variables:
      examplePageRule:
        fn::invoke:
          function: cloudflare:getPageRule
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            pageruleId: 023e105f4ecef8ad9ca31a8372d0c353
    

    Using getPageRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPageRule(args: GetPageRuleArgs, opts?: InvokeOptions): Promise<GetPageRuleResult>
    function getPageRuleOutput(args: GetPageRuleOutputArgs, opts?: InvokeOptions): Output<GetPageRuleResult>
    def get_page_rule(pagerule_id: Optional[str] = None,
                      zone_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetPageRuleResult
    def get_page_rule_output(pagerule_id: Optional[pulumi.Input[str]] = None,
                      zone_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetPageRuleResult]
    func LookupPageRule(ctx *Context, args *LookupPageRuleArgs, opts ...InvokeOption) (*LookupPageRuleResult, error)
    func LookupPageRuleOutput(ctx *Context, args *LookupPageRuleOutputArgs, opts ...InvokeOption) LookupPageRuleResultOutput

    > Note: This function is named LookupPageRule in the Go SDK.

    public static class GetPageRule 
    {
        public static Task<GetPageRuleResult> InvokeAsync(GetPageRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetPageRuleResult> Invoke(GetPageRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPageRuleResult> getPageRule(GetPageRuleArgs args, InvokeOptions options)
    public static Output<GetPageRuleResult> getPageRule(GetPageRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getPageRule:getPageRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PageruleId string
    Identifier
    ZoneId string
    Identifier
    PageruleId string
    Identifier
    ZoneId string
    Identifier
    pageruleId String
    Identifier
    zoneId String
    Identifier
    pageruleId string
    Identifier
    zoneId string
    Identifier
    pagerule_id str
    Identifier
    zone_id str
    Identifier
    pageruleId String
    Identifier
    zoneId String
    Identifier

    getPageRule Result

    The following output properties are available:

    CreatedOn string
    The timestamp of when the Page Rule was created.
    Id string
    Identifier
    ModifiedOn string
    The timestamp of when the Page Rule was last modified.
    PageruleId string
    Identifier
    Priority int
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    Status string
    The status of the Page Rule. Available values: "active", "disabled".
    ZoneId string
    Identifier
    CreatedOn string
    The timestamp of when the Page Rule was created.
    Id string
    Identifier
    ModifiedOn string
    The timestamp of when the Page Rule was last modified.
    PageruleId string
    Identifier
    Priority int
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    Status string
    The status of the Page Rule. Available values: "active", "disabled".
    ZoneId string
    Identifier
    createdOn String
    The timestamp of when the Page Rule was created.
    id String
    Identifier
    modifiedOn String
    The timestamp of when the Page Rule was last modified.
    pageruleId String
    Identifier
    priority Integer
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    status String
    The status of the Page Rule. Available values: "active", "disabled".
    zoneId String
    Identifier
    createdOn string
    The timestamp of when the Page Rule was created.
    id string
    Identifier
    modifiedOn string
    The timestamp of when the Page Rule was last modified.
    pageruleId string
    Identifier
    priority number
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    status string
    The status of the Page Rule. Available values: "active", "disabled".
    zoneId string
    Identifier
    created_on str
    The timestamp of when the Page Rule was created.
    id str
    Identifier
    modified_on str
    The timestamp of when the Page Rule was last modified.
    pagerule_id str
    Identifier
    priority int
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    status str
    The status of the Page Rule. Available values: "active", "disabled".
    zone_id str
    Identifier
    createdOn String
    The timestamp of when the Page Rule was created.
    id String
    Identifier
    modifiedOn String
    The timestamp of when the Page Rule was last modified.
    pageruleId String
    Identifier
    priority Number
    The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: /images/*) but want a more specific Page Rule to take precedence (rule B: /images/special/*), specify a higher priority for rule B so it overrides rule A.
    status String
    The status of the Page Rule. Available values: "active", "disabled".
    zoneId String
    Identifier

    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 v6.1.2 published on Monday, Apr 28, 2025 by Pulumi