1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getRulesets
Cloudflare v6.10.0 published on Thursday, Oct 2, 2025 by Pulumi

cloudflare.getRulesets

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.10.0 published on Thursday, Oct 2, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleRulesets = cloudflare.getRulesets({
        zoneId: "9f1839b6152d298aca64c4e906b6d074",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_rulesets = cloudflare.get_rulesets(zone_id="9f1839b6152d298aca64c4e906b6d074")
    
    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.LookupRulesets(ctx, &cloudflare.LookupRulesetsArgs{
    			ZoneId: pulumi.StringRef("9f1839b6152d298aca64c4e906b6d074"),
    		}, 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 exampleRulesets = Cloudflare.GetRulesets.Invoke(new()
        {
            ZoneId = "9f1839b6152d298aca64c4e906b6d074",
        });
    
    });
    
    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.GetRulesetsArgs;
    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 exampleRulesets = CloudflareFunctions.getRulesets(GetRulesetsArgs.builder()
                .zoneId("9f1839b6152d298aca64c4e906b6d074")
                .build());
    
        }
    }
    
    variables:
      exampleRulesets:
        fn::invoke:
          function: cloudflare:getRulesets
          arguments:
            zoneId: 9f1839b6152d298aca64c4e906b6d074
    

    Using getRulesets

    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 getRulesets(args: GetRulesetsArgs, opts?: InvokeOptions): Promise<GetRulesetsResult>
    function getRulesetsOutput(args: GetRulesetsOutputArgs, opts?: InvokeOptions): Output<GetRulesetsResult>
    def get_rulesets(account_id: Optional[str] = None,
                     max_items: Optional[int] = None,
                     zone_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetRulesetsResult
    def get_rulesets_output(account_id: Optional[pulumi.Input[str]] = None,
                     max_items: Optional[pulumi.Input[int]] = None,
                     zone_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetRulesetsResult]
    func LookupRulesets(ctx *Context, args *LookupRulesetsArgs, opts ...InvokeOption) (*LookupRulesetsResult, error)
    func LookupRulesetsOutput(ctx *Context, args *LookupRulesetsOutputArgs, opts ...InvokeOption) LookupRulesetsResultOutput

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

    public static class GetRulesets 
    {
        public static Task<GetRulesetsResult> InvokeAsync(GetRulesetsArgs args, InvokeOptions? opts = null)
        public static Output<GetRulesetsResult> Invoke(GetRulesetsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRulesetsResult> getRulesets(GetRulesetsArgs args, InvokeOptions options)
    public static Output<GetRulesetsResult> getRulesets(GetRulesetsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getRulesets:getRulesets
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    The unique ID of the account.
    MaxItems int
    Maximum number of rulesets to fetch (defaults to 1000).
    ZoneId string
    The unique ID of the zone.
    AccountId string
    The unique ID of the account.
    MaxItems int
    Maximum number of rulesets to fetch (defaults to 1000).
    ZoneId string
    The unique ID of the zone.
    accountId String
    The unique ID of the account.
    maxItems Integer
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId String
    The unique ID of the zone.
    accountId string
    The unique ID of the account.
    maxItems number
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId string
    The unique ID of the zone.
    account_id str
    The unique ID of the account.
    max_items int
    Maximum number of rulesets to fetch (defaults to 1000).
    zone_id str
    The unique ID of the zone.
    accountId String
    The unique ID of the account.
    maxItems Number
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId String
    The unique ID of the zone.

    getRulesets Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetRulesetsResult>
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    Rulesets List<GetRulesetsRuleset>
    A list of rulesets. The returned information will not include the rules in each ruleset.
    AccountId string
    The unique ID of the account.
    MaxItems int
    Maximum number of rulesets to fetch (defaults to 1000).
    ZoneId string
    The unique ID of the zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetRulesetsResult
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    Rulesets []GetRulesetsRuleset
    A list of rulesets. The returned information will not include the rules in each ruleset.
    AccountId string
    The unique ID of the account.
    MaxItems int
    Maximum number of rulesets to fetch (defaults to 1000).
    ZoneId string
    The unique ID of the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetRulesetsResult>
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    rulesets List<GetRulesetsRuleset>
    A list of rulesets. The returned information will not include the rules in each ruleset.
    accountId String
    The unique ID of the account.
    maxItems Integer
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId String
    The unique ID of the zone.
    id string
    The provider-assigned unique ID for this managed resource.
    results GetRulesetsResult[]
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    rulesets GetRulesetsRuleset[]
    A list of rulesets. The returned information will not include the rules in each ruleset.
    accountId string
    The unique ID of the account.
    maxItems number
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId string
    The unique ID of the zone.
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetRulesetsResult]
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    rulesets Sequence[GetRulesetsRuleset]
    A list of rulesets. The returned information will not include the rules in each ruleset.
    account_id str
    The unique ID of the account.
    max_items int
    Maximum number of rulesets to fetch (defaults to 1000).
    zone_id str
    The unique ID of the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    A list of rulesets. The returned information will not include the rules in each ruleset.

    Deprecated: Use rulesets instead. This attribute will be removed in the next major version of the provider.

    rulesets List<Property Map>
    A list of rulesets. The returned information will not include the rules in each ruleset.
    accountId String
    The unique ID of the account.
    maxItems Number
    Maximum number of rulesets to fetch (defaults to 1000).
    zoneId String
    The unique ID of the zone.

    Supporting Types

    GetRulesetsResult

    Description string
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    Id string
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    Kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    LastUpdated string
    The timestamp of when the ruleset was last modified.
    Name string
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    Phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    Version string
    The version of the ruleset.
    Description string
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    Id string
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    Kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    LastUpdated string
    The timestamp of when the ruleset was last modified.
    Name string
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    Phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    Version string
    The version of the ruleset.
    description String
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    id String
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    kind String
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    lastUpdated String
    The timestamp of when the ruleset was last modified.
    name String
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    phase String
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    version String
    The version of the ruleset.
    description string
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    id string
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    lastUpdated string
    The timestamp of when the ruleset was last modified.
    name string
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    version string
    The version of the ruleset.
    description str
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    id str
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    kind str
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    last_updated str
    The timestamp of when the ruleset was last modified.
    name str
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    phase str
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    version str
    The version of the ruleset.
    description String
    An informative description of the ruleset.

    Deprecated: Use rulesets.description instead. This attribute will be removed in the next major version of the provider.

    id String
    The unique ID of the ruleset.

    Deprecated: Use rulesets.id instead. This attribute will be removed in the next major version of the provider.

    kind String
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".

    Deprecated: Use rulesets.kind instead. This attribute will be removed in the next major version of the provider.

    lastUpdated String
    The timestamp of when the ruleset was last modified.
    name String
    The human-readable name of the ruleset.

    Deprecated: Use rulesets.name instead. This attribute will be removed in the next major version of the provider.

    phase String
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".

    Deprecated: Use rulesets.phase instead. This attribute will be removed in the next major version of the provider.

    version String
    The version of the ruleset.

    GetRulesetsRuleset

    Description string
    An informative description of the ruleset.
    Id string
    The unique ID of the ruleset.
    Kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    LastUpdated string
    The timestamp of when the ruleset was last modified.
    Name string
    The human-readable name of the ruleset.
    Phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    Version string
    The version of the ruleset.
    Description string
    An informative description of the ruleset.
    Id string
    The unique ID of the ruleset.
    Kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    LastUpdated string
    The timestamp of when the ruleset was last modified.
    Name string
    The human-readable name of the ruleset.
    Phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    Version string
    The version of the ruleset.
    description String
    An informative description of the ruleset.
    id String
    The unique ID of the ruleset.
    kind String
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    lastUpdated String
    The timestamp of when the ruleset was last modified.
    name String
    The human-readable name of the ruleset.
    phase String
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    version String
    The version of the ruleset.
    description string
    An informative description of the ruleset.
    id string
    The unique ID of the ruleset.
    kind string
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    lastUpdated string
    The timestamp of when the ruleset was last modified.
    name string
    The human-readable name of the ruleset.
    phase string
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    version string
    The version of the ruleset.
    description str
    An informative description of the ruleset.
    id str
    The unique ID of the ruleset.
    kind str
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    last_updated str
    The timestamp of when the ruleset was last modified.
    name str
    The human-readable name of the ruleset.
    phase str
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    version str
    The version of the ruleset.
    description String
    An informative description of the ruleset.
    id String
    The unique ID of the ruleset.
    kind String
    The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
    lastUpdated String
    The timestamp of when the ruleset was last modified.
    name String
    The human-readable name of the ruleset.
    phase String
    The phase of the ruleset. Available values: "ddosl4", "ddosl7", "httpconfigsettings", "httpcustomerrors", "httplogcustomfields", "httpratelimit", "httprequestcachesettings", "httprequestdynamicredirect", "httprequestfirewallcustom", "httprequestfirewallmanaged", "httprequestlatetransform", "httprequestorigin", "httprequestredirect", "httprequestsanitize", "httprequestsbfm", "httprequesttransform", "httpresponsecompression", "httpresponsefirewallmanaged", "httpresponseheaderstransform", "magictransit", "magictransitidsmanaged", "magictransitmanaged", "magictransit_ratelimit".
    version String
    The version of the ruleset.

    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.10.0 published on Thursday, Oct 2, 2025 by Pulumi
      AI Agentic Workflows: Register now