Cloudflare
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
new AccessRule(name: string, args: AccessRuleArgs, opts?: CustomResourceOptions);
@overload
def AccessRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
configuration: Optional[AccessRuleConfigurationArgs] = None,
mode: Optional[str] = None,
notes: Optional[str] = None,
zone_id: Optional[str] = None)
@overload
def AccessRule(resource_name: str,
args: AccessRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewAccessRule(ctx *Context, name string, args AccessRuleArgs, opts ...ResourceOption) (*AccessRule, error)
public AccessRule(string name, AccessRuleArgs args, CustomResourceOptions? opts = null)
public AccessRule(String name, AccessRuleArgs args)
public AccessRule(String name, AccessRuleArgs args, CustomResourceOptions options)
type: cloudflare:AccessRule
properties: # The arguments to resource properties.
options: # 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.
- resource_name str
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts docs.
Inputs
The AccessRule resource accepts the following input properties:
- Configuration
Access
Rule Configuration Args 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", "managed_challenge"
- Notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- Zone
Id string The DNS zone to which the access rule should be added.
- Configuration
Access
Rule Configuration Args 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", "managed_challenge"
- Notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- Zone
Id string The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_challenge"
- notes String
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id String The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_challenge"
- notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id string The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_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.
- configuration Property Map
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", "managed_challenge"
- notes String
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id String 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 string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
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
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
configuration: Optional[AccessRuleConfigurationArgs] = None,
mode: Optional[str] = None,
notes: Optional[str] = None,
zone_id: Optional[str] = None) -> AccessRule
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)
public static AccessRule get(String name, Output<String> id, AccessRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Configuration
Access
Rule Configuration Args 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", "managed_challenge"
- Notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- Zone
Id string The DNS zone to which the access rule should be added.
- Configuration
Access
Rule Configuration Args 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", "managed_challenge"
- Notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- Zone
Id string The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_challenge"
- notes String
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id String The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_challenge"
- notes string
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id string The DNS zone to which the access rule should be added.
- configuration
Access
Rule Configuration Args 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", "managed_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.
- configuration Property Map
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", "managed_challenge"
- notes String
A personal note about the rule. Typically used as a reminder or explanation for the rule.
- zone
Id String The DNS zone to which the access rule should be added.
Supporting Types
AccessRuleConfiguration
Import
Records can be imported using a composite ID formed of access rule type, access rule type identifier and identifer value, e.g.
$ pulumi import cloudflare:index/accessRule:AccessRule default zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e
where* zone
- access rule type (account
, zone
or user
) * cb029e245cfdd66dc8d2e570d5dd3322
- access rule type ID (i.e the zone ID
or account ID you wish to target) * d41d8cd98f00b204e9800998ecf8427e
- access rule ID as returned by
respective API endpoint for the type you are attempting to import.
Package Details
- Repository
- https://github.com/pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
cloudflare
Terraform Provider.