AccessRule

Provides a Cloudflare IP Firewall Access Rule resource. Access control can be applied on basis of IP addresses, IP ranges, AS numbers or countries.

Create a AccessRule Resource

def AccessRule(resource_name, opts=None, configuration=None, mode=None, notes=None, zone_id=None, __props__=None);
func NewAccessRule(ctx *Context, name string, args AccessRuleArgs, opts ...ResourceOption) (*AccessRule, error)
public AccessRule(string name, AccessRuleArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AccessRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AccessRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AccessRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AccessRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AccessRule resource accepts the following input properties:

Configuration AccessRuleConfigurationArgs

Rule configuration to apply to a matched request. It’s a complex value. See description below.

Mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

Notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

ZoneId string

The DNS zone to which the access rule should be added.

Configuration AccessRuleConfiguration

Rule configuration to apply to a matched request. It’s a complex value. See description below.

Mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

Notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

ZoneId string

The DNS zone to which the access rule should be added.

configuration AccessRuleConfiguration

Rule configuration to apply to a matched request. It’s a complex value. See description below.

mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

zoneId string

The DNS zone to which the access rule should be added.

configuration Dict[AccessRuleConfiguration]

Rule configuration to apply to a matched request. It’s a complex value. See description below.

mode str

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

notes str

A personal note about the rule. Typically used as a reminder or explanation for the rule.

zone_id str

The DNS zone to which the access rule should be added.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccessRule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing AccessRule Resource

Get an existing AccessRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AccessRuleState, opts?: CustomResourceOptions): AccessRule
static get(resource_name, id, opts=None, configuration=None, mode=None, notes=None, zone_id=None, __props__=None);
func GetAccessRule(ctx *Context, name string, id IDInput, state *AccessRuleState, opts ...ResourceOption) (*AccessRule, error)
public static AccessRule Get(string name, Input<string> id, AccessRuleState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Configuration AccessRuleConfigurationArgs

Rule configuration to apply to a matched request. It’s a complex value. See description below.

Mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

Notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

ZoneId string

The DNS zone to which the access rule should be added.

Configuration AccessRuleConfiguration

Rule configuration to apply to a matched request. It’s a complex value. See description below.

Mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

Notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

ZoneId string

The DNS zone to which the access rule should be added.

configuration AccessRuleConfiguration

Rule configuration to apply to a matched request. It’s a complex value. See description below.

mode string

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

notes string

A personal note about the rule. Typically used as a reminder or explanation for the rule.

zoneId string

The DNS zone to which the access rule should be added.

configuration Dict[AccessRuleConfiguration]

Rule configuration to apply to a matched request. It’s a complex value. See description below.

mode str

The action to apply to a matched request. Allowed values: “block”, “challenge”, “whitelist”, “js_challenge”

notes str

A personal note about the rule. Typically used as a reminder or explanation for the rule.

zone_id str

The DNS zone to which the access rule should be added.

Supporting Types

AccessRuleConfiguration

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Target string

The request property to target. Allowed values: “ip”, “ip6”, “ip_range”, “asn”, “country”

Value string

The value to target. Depends on target’s type.

Target string

The request property to target. Allowed values: “ip”, “ip6”, “ip_range”, “asn”, “country”

Value string

The value to target. Depends on target’s type.

target string

The request property to target. Allowed values: “ip”, “ip6”, “ip_range”, “asn”, “country”

value string

The value to target. Depends on target’s type.

target str

The request property to target. Allowed values: “ip”, “ip6”, “ip_range”, “asn”, “country”

value str

The value to target. Depends on target’s type.

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.