Class ZoneLockdown
Provides a Cloudflare Zone Lockdown resource. Zone Lockdown allows you to define one or more URLs (with wildcard matching on the domain or path) that will only permit access if the request originates from an IP address that matches a safelist of one or more IP addresses and/or IP ranges.
Example Usage
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
// Restrict access to these endpoints to requests from a known IP address.
var endpointLockdown = new Cloudflare.ZoneLockdown("endpointLockdown", new Cloudflare.ZoneLockdownArgs
{
Configurations =
{
new Cloudflare.Inputs.ZoneLockdownConfigurationArgs
{
Target = "ip",
Value = "198.51.100.4",
},
},
Description = "Restrict access to these endpoints to requests from a known IP address",
Paused = "false",
Urls =
{
"api.mysite.com/some/endpoint*",
},
ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
});
}
}
Inherited Members
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class ZoneLockdown : CustomResource
Constructors
View SourceZoneLockdown(String, ZoneLockdownArgs, CustomResourceOptions)
Create a ZoneLockdown resource with the given unique name, arguments, and options.
Declaration
public ZoneLockdown(string name, ZoneLockdownArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ZoneLockdownArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceConfigurations
A list of IP addresses or IP ranges to match the request against specified in target, value pairs. It's a complex value. See description below. The order of the configuration entries is unimportant.
Declaration
public Output<ImmutableArray<ZoneLockdownConfiguration>> Configurations { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ZoneLockdownConfiguration>> |
Description
A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Paused
Boolean of whether this zone lockdown is currently paused. Default: false.
Declaration
public Output<bool?> Paused { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Priority
Declaration
public Output<int?> Priority { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Urls
A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
Declaration
public Output<ImmutableArray<string>> Urls { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ZoneId
The DNS zone ID to which the access rule should be added.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ZoneLockdownState, CustomResourceOptions)
Get an existing ZoneLockdown resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ZoneLockdown Get(string name, Input<string> id, ZoneLockdownState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ZoneLockdownState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ZoneLockdown |