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

cloudflare.getRulesets

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 exampleRulesets = cloudflare.getRulesets({
        accountId: "account_id",
        zoneId: "zone_id",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_rulesets = cloudflare.get_rulesets(account_id="account_id",
        zone_id="zone_id")
    
    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{
    			AccountId: pulumi.StringRef("account_id"),
    			ZoneId:    pulumi.StringRef("zone_id"),
    		}, 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()
        {
            AccountId = "account_id",
            ZoneId = "zone_id",
        });
    
    });
    
    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()
                .accountId("account_id")
                .zoneId("zone_id")
                .build());
    
        }
    }
    
    variables:
      exampleRulesets:
        fn::invoke:
          function: cloudflare:getRulesets
          arguments:
            accountId: account_id
            zoneId: zone_id
    

    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 Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    MaxItems int
    Max items to fetch, default: 1000
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    MaxItems int
    Max items to fetch, default: 1000
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems Integer
    Max items to fetch, default: 1000
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems number
    Max items to fetch, default: 1000
    zoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    account_id str
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    max_items int
    Max items to fetch, default: 1000
    zone_id str
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems Number
    Max items to fetch, default: 1000
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

    getRulesets Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetRulesetsResult>
    The items returned by the data source
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    MaxItems int
    Max items to fetch, default: 1000
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetRulesetsResult
    The items returned by the data source
    AccountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    MaxItems int
    Max items to fetch, default: 1000
    ZoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetRulesetsResult>
    The items returned by the data source
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems Integer
    Max items to fetch, default: 1000
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    id string
    The provider-assigned unique ID for this managed resource.
    results GetRulesetsResult[]
    The items returned by the data source
    accountId string
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems number
    Max items to fetch, default: 1000
    zoneId string
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetRulesetsResult]
    The items returned by the data source
    account_id str
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    max_items int
    Max items to fetch, default: 1000
    zone_id str
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    The items returned by the data source
    accountId String
    The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
    maxItems Number
    Max items to fetch, default: 1000
    zoneId String
    The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

    Supporting Types

    GetRulesetsResult

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

    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