1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getRulesets
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.getRulesets

Explore with Pulumi AI

Cloudflare v6.0.1 published on Wednesday, Apr 16, 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",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_rulesets = cloudflare.get_rulesets(account_id="account_id",
    zone_id="zone_id")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  exampleRulesets:
    fn::invoke:
      function: cloudflare:getRulesets
      arguments:
        accountId: account_id
        zoneId: zone_id
Copy

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>
Copy
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]
Copy
func LookupRulesets(ctx *Context, args *LookupRulesetsArgs, opts ...InvokeOption) (*LookupRulesetsResult, error)
func LookupRulesetsOutput(ctx *Context, args *LookupRulesetsOutputArgs, opts ...InvokeOption) LookupRulesetsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRulesetsResult> getRulesets(GetRulesetsArgs args, InvokeOptions options)
public static Output<GetRulesetsResult> getRulesets(GetRulesetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getRulesets:getRulesets
  arguments:
    # arguments dictionary
Copy

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 This property is required. string
An informative description of the ruleset.
Id This property is required. string
The unique ID of the ruleset.
Kind This property is required. string
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
LastUpdated This property is required. string
The timestamp of when the ruleset was last modified.
Name This property is required. string
The human-readable name of the ruleset.
Phase This property is required. 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 This property is required. string
An informative description of the ruleset.
Id This property is required. string
The unique ID of the ruleset.
Kind This property is required. string
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
LastUpdated This property is required. string
The timestamp of when the ruleset was last modified.
Name This property is required. string
The human-readable name of the ruleset.
Phase This property is required. 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 This property is required. String
An informative description of the ruleset.
id This property is required. String
The unique ID of the ruleset.
kind This property is required. String
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
lastUpdated This property is required. String
The timestamp of when the ruleset was last modified.
name This property is required. String
The human-readable name of the ruleset.
phase This property is required. 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 This property is required. string
An informative description of the ruleset.
id This property is required. string
The unique ID of the ruleset.
kind This property is required. string
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
lastUpdated This property is required. string
The timestamp of when the ruleset was last modified.
name This property is required. string
The human-readable name of the ruleset.
phase This property is required. 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 This property is required. str
An informative description of the ruleset.
id This property is required. str
The unique ID of the ruleset.
kind This property is required. str
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
last_updated This property is required. str
The timestamp of when the ruleset was last modified.
name This property is required. str
The human-readable name of the ruleset.
phase This property is required. 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 This property is required. String
An informative description of the ruleset.
id This property is required. String
The unique ID of the ruleset.
kind This property is required. String
The kind of the ruleset. Available values: "managed", "custom", "root", "zone".
lastUpdated This property is required. String
The timestamp of when the ruleset was last modified.
name This property is required. String
The human-readable name of the ruleset.
phase This property is required. 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 v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi