ZoneLockdownArgs

data class ZoneLockdownArgs(val configurations: Output<List<ZoneLockdownConfigurationArgs>>? = null, val description: Output<String>? = null, val paused: Output<Boolean>? = null, val priority: Output<Int>? = null, val urls: Output<List<String>>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ZoneLockdownArgs>

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

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
// Restrict access to these endpoints to requests from a known IP address range.
const example = new cloudflare.ZoneLockdown("example", {
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
paused: false,
description: "Restrict access to these endpoints to requests from a known IP address range",
urls: ["api&#46;mysite&#46;com/some/endpoint*"],
configurations: [{
target: "ip_range",
value: "192.0.2.0/24",
}],
});
import pulumi
import pulumi_cloudflare as cloudflare
# Restrict access to these endpoints to requests from a known IP address range.
example = cloudflare.ZoneLockdown("example",
zone_id="0da42c8d2132a9ddaf714f9e7c920711",
paused=False,
description="Restrict access to these endpoints to requests from a known IP address range",
urls=["api&#46;mysite&#46;com/some/endpoint*"],
configurations=[{
"target": "ip_range",
"value": "192.0.2.0/24",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
// Restrict access to these endpoints to requests from a known IP address range.
var example = new Cloudflare.ZoneLockdown("example", new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Paused = false,
Description = "Restrict access to these endpoints to requests from a known IP address range",
Urls = new[]
{
"api.mysite.com/some/endpoint*",
},
Configurations = new[]
{
new Cloudflare.Inputs.ZoneLockdownConfigurationArgs
{
Target = "ip_range",
Value = "192.0.2.0/24",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Restrict access to these endpoints to requests from a known IP address range.
_, err := cloudflare.NewZoneLockdown(ctx, "example", &cloudflare.ZoneLockdownArgs{
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
Paused: pulumi.Bool(false),
Description: pulumi.String("Restrict access to these endpoints to requests from a known IP address range"),
Urls: pulumi.StringArray{
pulumi.String("api.mysite.com/some/endpoint*"),
},
Configurations: cloudflare.ZoneLockdownConfigurationArray{
&cloudflare.ZoneLockdownConfigurationArgs{
Target: pulumi.String("ip_range"),
Value: pulumi.String("192.0.2.0/24"),
},
},
})
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.ZoneLockdown;
import com.pulumi.cloudflare.ZoneLockdownArgs;
import com.pulumi.cloudflare.inputs.ZoneLockdownConfigurationArgs;
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) {
// Restrict access to these endpoints to requests from a known IP address range.
var example = new ZoneLockdown("example", ZoneLockdownArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.paused("false")
.description("Restrict access to these endpoints to requests from a known IP address range")
.urls("api.mysite.com/some/endpoint*")
.configurations(ZoneLockdownConfigurationArgs.builder()
.target("ip_range")
.value("192.0.2.0/24")
.build())
.build());
}
}
resources:
# Restrict access to these endpoints to requests from a known IP address range.
example:
type: cloudflare:ZoneLockdown
properties:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
paused: 'false'
description: Restrict access to these endpoints to requests from a known IP address range
urls:
- api.mysite.com/some/endpoint*
configurations:
- target: ip_range
value: 192.0.2.0/24

Import

$ pulumi import cloudflare:index/zoneLockdown:ZoneLockdown example <zone_id>/<lockdown_id>

Constructors

Link copied to clipboard
constructor(configurations: Output<List<ZoneLockdownConfigurationArgs>>? = null, description: Output<String>? = null, paused: Output<Boolean>? = null, priority: Output<Int>? = null, urls: Output<List<String>>? = null, zoneId: Output<String>? = null)

Properties

Link copied to clipboard

A list of IP addresses or IP ranges to match the request against specified in target, value pairs.

Link copied to clipboard
val description: Output<String>? = null

A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.

Link copied to clipboard
val paused: Output<Boolean>? = null

Boolean of whether this zone lockdown is currently paused. Defaults to false.

Link copied to clipboard
val priority: Output<Int>? = null
Link copied to clipboard
val urls: Output<List<String>>? = null

A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.

Link copied to clipboard
val zoneId: Output<String>? = null

The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Functions

Link copied to clipboard
open override fun toJava(): ZoneLockdownArgs