1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. ZoneLockdown
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.ZoneLockdown

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleZoneLockdown = new cloudflare.ZoneLockdown("example_zone_lockdown", {
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        configurations: [{
            target: "ip",
            value: "198.51.100.4",
        }],
        urls: ["shop.example.com/*"],
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_zone_lockdown = cloudflare.ZoneLockdown("example_zone_lockdown",
        zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        configurations=[{
            "target": "ip",
            "value": "198.51.100.4",
        }],
        urls=["shop.example.com/*"])
    
    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.NewZoneLockdown(ctx, "example_zone_lockdown", &cloudflare.ZoneLockdownArgs{
    			ZoneId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			Configurations: cloudflare.ZoneLockdownConfigurationArray{
    				&cloudflare.ZoneLockdownConfigurationArgs{
    					Target: pulumi.String("ip"),
    					Value:  pulumi.String("198.51.100.4"),
    				},
    			},
    			Urls: pulumi.StringArray{
    				pulumi.String("shop.example.com/*"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleZoneLockdown = new Cloudflare.ZoneLockdown("example_zone_lockdown", new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            Configurations = new[]
            {
                new Cloudflare.Inputs.ZoneLockdownConfigurationArgs
                {
                    Target = "ip",
                    Value = "198.51.100.4",
                },
            },
            Urls = new[]
            {
                "shop.example.com/*",
            },
        });
    
    });
    
    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) {
            var exampleZoneLockdown = new ZoneLockdown("exampleZoneLockdown", ZoneLockdownArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .configurations(ZoneLockdownConfigurationArgs.builder()
                    .target("ip")
                    .value("198.51.100.4")
                    .build())
                .urls("shop.example.com/*")
                .build());
    
        }
    }
    
    resources:
      exampleZoneLockdown:
        type: cloudflare:ZoneLockdown
        name: example_zone_lockdown
        properties:
          zoneId: 023e105f4ecef8ad9ca31a8372d0c353
          configurations:
            - target: ip
              value: 198.51.100.4
          urls:
            - shop.example.com/*
    

    Create ZoneLockdown Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ZoneLockdown(name: string, args: ZoneLockdownArgs, opts?: CustomResourceOptions);
    @overload
    def ZoneLockdown(resource_name: str,
                     args: ZoneLockdownArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ZoneLockdown(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     configurations: Optional[Sequence[ZoneLockdownConfigurationArgs]] = None,
                     urls: Optional[Sequence[str]] = None,
                     zone_id: Optional[str] = None)
    func NewZoneLockdown(ctx *Context, name string, args ZoneLockdownArgs, opts ...ResourceOption) (*ZoneLockdown, error)
    public ZoneLockdown(string name, ZoneLockdownArgs args, CustomResourceOptions? opts = null)
    public ZoneLockdown(String name, ZoneLockdownArgs args)
    public ZoneLockdown(String name, ZoneLockdownArgs args, CustomResourceOptions options)
    
    type: cloudflare:ZoneLockdown
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ZoneLockdownArgs
    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 ZoneLockdownArgs
    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 ZoneLockdownArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneLockdownArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ZoneLockdownArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var zoneLockdownResource = new Cloudflare.ZoneLockdown("zoneLockdownResource", new()
    {
        Configurations = new[]
        {
            new Cloudflare.Inputs.ZoneLockdownConfigurationArgs
            {
                Target = "string",
                Value = "string",
            },
        },
        Urls = new[]
        {
            "string",
        },
        ZoneId = "string",
    });
    
    example, err := cloudflare.NewZoneLockdown(ctx, "zoneLockdownResource", &cloudflare.ZoneLockdownArgs{
    	Configurations: cloudflare.ZoneLockdownConfigurationArray{
    		&cloudflare.ZoneLockdownConfigurationArgs{
    			Target: pulumi.String("string"),
    			Value:  pulumi.String("string"),
    		},
    	},
    	Urls: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ZoneId: pulumi.String("string"),
    })
    
    var zoneLockdownResource = new ZoneLockdown("zoneLockdownResource", ZoneLockdownArgs.builder()
        .configurations(ZoneLockdownConfigurationArgs.builder()
            .target("string")
            .value("string")
            .build())
        .urls("string")
        .zoneId("string")
        .build());
    
    zone_lockdown_resource = cloudflare.ZoneLockdown("zoneLockdownResource",
        configurations=[{
            "target": "string",
            "value": "string",
        }],
        urls=["string"],
        zone_id="string")
    
    const zoneLockdownResource = new cloudflare.ZoneLockdown("zoneLockdownResource", {
        configurations: [{
            target: "string",
            value: "string",
        }],
        urls: ["string"],
        zoneId: "string",
    });
    
    type: cloudflare:ZoneLockdown
    properties:
        configurations:
            - target: string
              value: string
        urls:
            - string
        zoneId: string
    

    ZoneLockdown Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ZoneLockdown resource accepts the following input properties:

    Configurations List<ZoneLockdownConfiguration>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    Urls List<string>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    ZoneId string
    Identifier
    Configurations []ZoneLockdownConfigurationArgs
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    Urls []string
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    ZoneId string
    Identifier
    configurations List<ZoneLockdownConfiguration>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    urls List<String>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId String
    Identifier
    configurations ZoneLockdownConfiguration[]
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    urls string[]
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId string
    Identifier
    configurations Sequence[ZoneLockdownConfigurationArgs]
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    urls Sequence[str]
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zone_id str
    Identifier
    configurations List<Property Map>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    urls List<String>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId String
    Identifier

    Outputs

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

    CreatedOn string
    The timestamp of when the rule was created.
    Description string
    An informative summary of the rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    The timestamp of when the rule was last modified.
    Paused bool
    When true, indicates that the rule is currently paused.
    CreatedOn string
    The timestamp of when the rule was created.
    Description string
    An informative summary of the rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    The timestamp of when the rule was last modified.
    Paused bool
    When true, indicates that the rule is currently paused.
    createdOn String
    The timestamp of when the rule was created.
    description String
    An informative summary of the rule.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    The timestamp of when the rule was last modified.
    paused Boolean
    When true, indicates that the rule is currently paused.
    createdOn string
    The timestamp of when the rule was created.
    description string
    An informative summary of the rule.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn string
    The timestamp of when the rule was last modified.
    paused boolean
    When true, indicates that the rule is currently paused.
    created_on str
    The timestamp of when the rule was created.
    description str
    An informative summary of the rule.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_on str
    The timestamp of when the rule was last modified.
    paused bool
    When true, indicates that the rule is currently paused.
    createdOn String
    The timestamp of when the rule was created.
    description String
    An informative summary of the rule.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    The timestamp of when the rule was last modified.
    paused Boolean
    When true, indicates that the rule is currently paused.

    Look up Existing ZoneLockdown Resource

    Get an existing ZoneLockdown 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?: ZoneLockdownState, opts?: CustomResourceOptions): ZoneLockdown
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            configurations: Optional[Sequence[ZoneLockdownConfigurationArgs]] = None,
            created_on: Optional[str] = None,
            description: Optional[str] = None,
            modified_on: Optional[str] = None,
            paused: Optional[bool] = None,
            urls: Optional[Sequence[str]] = None,
            zone_id: Optional[str] = None) -> ZoneLockdown
    func GetZoneLockdown(ctx *Context, name string, id IDInput, state *ZoneLockdownState, opts ...ResourceOption) (*ZoneLockdown, error)
    public static ZoneLockdown Get(string name, Input<string> id, ZoneLockdownState? state, CustomResourceOptions? opts = null)
    public static ZoneLockdown get(String name, Output<String> id, ZoneLockdownState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:ZoneLockdown    get:      id: ${id}
    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.
    The following state arguments are supported:
    Configurations List<ZoneLockdownConfiguration>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    CreatedOn string
    The timestamp of when the rule was created.
    Description string
    An informative summary of the rule.
    ModifiedOn string
    The timestamp of when the rule was last modified.
    Paused bool
    When true, indicates that the rule is currently paused.
    Urls List<string>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    ZoneId string
    Identifier
    Configurations []ZoneLockdownConfigurationArgs
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    CreatedOn string
    The timestamp of when the rule was created.
    Description string
    An informative summary of the rule.
    ModifiedOn string
    The timestamp of when the rule was last modified.
    Paused bool
    When true, indicates that the rule is currently paused.
    Urls []string
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    ZoneId string
    Identifier
    configurations List<ZoneLockdownConfiguration>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    createdOn String
    The timestamp of when the rule was created.
    description String
    An informative summary of the rule.
    modifiedOn String
    The timestamp of when the rule was last modified.
    paused Boolean
    When true, indicates that the rule is currently paused.
    urls List<String>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId String
    Identifier
    configurations ZoneLockdownConfiguration[]
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    createdOn string
    The timestamp of when the rule was created.
    description string
    An informative summary of the rule.
    modifiedOn string
    The timestamp of when the rule was last modified.
    paused boolean
    When true, indicates that the rule is currently paused.
    urls string[]
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId string
    Identifier
    configurations Sequence[ZoneLockdownConfigurationArgs]
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    created_on str
    The timestamp of when the rule was created.
    description str
    An informative summary of the rule.
    modified_on str
    The timestamp of when the rule was last modified.
    paused bool
    When true, indicates that the rule is currently paused.
    urls Sequence[str]
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zone_id str
    Identifier
    configurations List<Property Map>
    A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
    createdOn String
    The timestamp of when the rule was created.
    description String
    An informative summary of the rule.
    modifiedOn String
    The timestamp of when the rule was last modified.
    paused Boolean
    When true, indicates that the rule is currently paused.
    urls List<String>
    The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
    zoneId String
    Identifier

    Supporting Types

    ZoneLockdownConfiguration, ZoneLockdownConfigurationArgs

    Target string
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    Value string
    The IP address to match. This address will be compared to the IP address of incoming requests.
    Target string
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    Value string
    The IP address to match. This address will be compared to the IP address of incoming requests.
    target String
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    value String
    The IP address to match. This address will be compared to the IP address of incoming requests.
    target string
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    value string
    The IP address to match. This address will be compared to the IP address of incoming requests.
    target str
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    value str
    The IP address to match. This address will be compared to the IP address of incoming requests.
    target String
    The configuration target. You must set the target to ip when specifying an IP address in the Zone Lockdown rule. Available values: "ip".
    value String
    The IP address to match. This address will be compared to the IP address of incoming requests.

    Import

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi