getAccessRules

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleAccessRules = cloudflare.getAccessRules({
accountId: "account_id",
zoneId: "zone_id",
configuration: {
target: "ip",
value: "198.51.100.4",
},
direction: "asc",
mode: "block",
notes: "my note",
order: "configuration.target",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_access_rules = cloudflare.get_access_rules(account_id="account_id",
zone_id="zone_id",
configuration={
"target": "ip",
"value": "198.51.100.4",
},
direction="asc",
mode="block",
notes="my note",
order="configuration.target")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleAccessRules = Cloudflare.GetAccessRules.Invoke(new()
{
AccountId = "account_id",
ZoneId = "zone_id",
Configuration = new Cloudflare.Inputs.GetAccessRulesConfigurationInputArgs
{
Target = "ip",
Value = "198.51.100.4",
},
Direction = "asc",
Mode = "block",
Notes = "my note",
Order = "configuration.target",
});
});
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.LookupAccessRules(ctx, &cloudflare.LookupAccessRulesArgs{
AccountId: pulumi.StringRef("account_id"),
ZoneId: pulumi.StringRef("zone_id"),
Configuration: cloudflare.GetAccessRulesConfiguration{
Target: pulumi.StringRef("ip"),
Value: pulumi.StringRef("198.51.100.4"),
},
Direction: pulumi.StringRef("asc"),
Mode: pulumi.StringRef("block"),
Notes: pulumi.StringRef("my note"),
Order: pulumi.StringRef("configuration.target"),
}, nil)
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.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetAccessRulesArgs;
import com.pulumi.cloudflare.inputs.GetAccessRulesConfigurationArgs;
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 exampleAccessRules = CloudflareFunctions.getAccessRules(GetAccessRulesArgs.builder()
.accountId("account_id")
.zoneId("zone_id")
.configuration(GetAccessRulesConfigurationArgs.builder()
.target("ip")
.value("198.51.100.4")
.build())
.direction("asc")
.mode("block")
.notes("my note")
.order("configuration.target")
.build());
}
}
variables:
exampleAccessRules:
fn::invoke:
function: cloudflare:getAccessRules
arguments:
accountId: account_id
zoneId: zone_id
configuration:
target: ip
value: 198.51.100.4
direction: asc
mode: block
notes: my note
order: configuration.target

Return

A collection of values returned by getAccessRules.

Parameters

argument

A collection of arguments for invoking getAccessRules.


suspend fun getAccessRules(accountId: String? = null, configuration: GetAccessRulesConfiguration? = null, direction: String? = null, match: String? = null, maxItems: Int? = null, mode: String? = null, notes: String? = null, order: String? = null, zoneId: String? = null): GetAccessRulesInvokeResult

Return

A collection of values returned by getAccessRules.

Parameters

accountId

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

configuration
direction

The direction used to sort returned rules. Available values: "asc", "desc".

match

When set to all, all the search requirements must match. When set to any, only one of the search requirements has to match. Available values: "any", "all".

maxItems

Max items to fetch, default: 1000

mode

The action to apply to a matched request. Available values: "block", "challenge", "whitelist", "jschallenge", "managedchallenge".

notes

The string to search for in the notes of existing IP Access rules. Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.

order

The field used to sort returned rules. Available values: "configuration.target", "configuration.value", "mode".

zoneId

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

See also


Return

A collection of values returned by getAccessRules.

Parameters

argument

Builder for com.pulumi.cloudflare.kotlin.inputs.GetAccessRulesPlainArgs.

See also