1. Packages
  2. Panos Provider
  3. API Docs
  4. Dhcp
panos 2.0.6 published on Wednesday, Nov 19, 2025 by paloaltonetworks
panos logo
panos 2.0.6 published on Wednesday, Nov 19, 2025 by paloaltonetworks

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as panos from "@pulumi/panos";
    
    // Configure a template
    const example = new panos.Template("example", {
        location: {
            panorama: {},
        },
        name: "example-template",
    });
    // Configure ethernet interfaces
    const eth1 = new panos.EthernetInterface("eth1", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: "ethernet1/1",
        layer3: {},
    });
    const eth2 = new panos.EthernetInterface("eth2", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: "ethernet1/2",
        layer3: {},
    });
    const eth3 = new panos.EthernetInterface("eth3", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: "ethernet1/3",
        layer3: {},
    });
    const eth4 = new panos.EthernetInterface("eth4", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: "ethernet1/4",
        layer3: {},
    });
    const eth5 = new panos.EthernetInterface("eth5", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: "ethernet1/5",
        layer3: {},
    });
    // DHCP Relay configuration
    const relayExample = new panos.Dhcp("relay_example", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: eth1.name,
        relay: {
            ip: {
                enabled: true,
                servers: [
                    "10.0.0.1",
                    "10.0.0.2",
                ],
            },
        },
    });
    // DHCP Relay IPv6 configuration
    const relayIpv6Example = new panos.Dhcp("relay_ipv6_example", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: eth2.name,
        relay: {
            ipv6: {
                enabled: true,
                servers: [
                    {
                        name: "2001:db8::1",
                        "interface": eth1.name,
                    },
                    {
                        name: "2001:db8::2",
                    },
                ],
            },
        },
    });
    // DHCP Server configuration with various options
    const serverExample = new panos.Dhcp("server_example", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: eth3.name,
        server: {
            ipPools: ["192.168.1.0/24"],
            mode: "enabled",
            option: {
                dns: {
                    primary: "8.8.8.8",
                    secondary: "8.8.4.4",
                },
                dnsSuffix: "example.com",
                gateway: "192.168.1.1",
                lease: {
                    timeout: 720,
                },
                nis: {
                    primary: "192.168.1.10",
                    secondary: "192.168.1.11",
                },
                ntp: {
                    primary: "192.168.1.20",
                    secondary: "192.168.1.21",
                },
                pop3Server: "192.168.1.30",
                smtpServer: "192.168.1.25",
                subnetMask: "255.255.255.0",
                wins: {
                    primary: "192.168.1.40",
                    secondary: "192.168.1.41",
                },
                userDefineds: [
                    {
                        name: "custom_ip_option",
                        code: 200,
                        ips: [
                            "10.0.0.1",
                            "10.0.0.2",
                        ],
                        inherited: false,
                    },
                    {
                        name: "custom_ascii_option",
                        code: 201,
                        asciis: ["custom option"],
                        inherited: false,
                    },
                    {
                        name: "custom_hex_option",
                        code: 202,
                        hexes: ["0A0B0C"],
                        inherited: false,
                    },
                ],
            },
            reserveds: [{
                name: "192.168.1.100",
                mac: "00:11:22:33:44:55",
                description: "reserved-printer",
            }],
        },
    });
    // DHCP Server configuration with unlimited lease
    const serverUnlimitedLeaseExample = new panos.Dhcp("server_unlimited_lease_example", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: eth4.name,
        server: {
            ipPools: ["192.168.2.0/24"],
            option: {
                lease: {
                    unlimited: {},
                },
            },
        },
    });
    // DHCP Server configuration with inheritance
    const serverInheritanceExample = new panos.Dhcp("server_inheritance_example", {
        location: {
            template: {
                name: example.name,
            },
        },
        name: eth5.name,
        server: {
            ipPools: ["192.168.3.0/24"],
            option: {
                inheritance: {
                    source: eth1.name,
                },
            },
        },
    });
    
    import pulumi
    import pulumi_panos as panos
    
    # Configure a template
    example = panos.Template("example",
        location={
            "panorama": {},
        },
        name="example-template")
    # Configure ethernet interfaces
    eth1 = panos.EthernetInterface("eth1",
        location={
            "template": {
                "name": example.name,
            },
        },
        name="ethernet1/1",
        layer3={})
    eth2 = panos.EthernetInterface("eth2",
        location={
            "template": {
                "name": example.name,
            },
        },
        name="ethernet1/2",
        layer3={})
    eth3 = panos.EthernetInterface("eth3",
        location={
            "template": {
                "name": example.name,
            },
        },
        name="ethernet1/3",
        layer3={})
    eth4 = panos.EthernetInterface("eth4",
        location={
            "template": {
                "name": example.name,
            },
        },
        name="ethernet1/4",
        layer3={})
    eth5 = panos.EthernetInterface("eth5",
        location={
            "template": {
                "name": example.name,
            },
        },
        name="ethernet1/5",
        layer3={})
    # DHCP Relay configuration
    relay_example = panos.Dhcp("relay_example",
        location={
            "template": {
                "name": example.name,
            },
        },
        name=eth1.name,
        relay={
            "ip": {
                "enabled": True,
                "servers": [
                    "10.0.0.1",
                    "10.0.0.2",
                ],
            },
        })
    # DHCP Relay IPv6 configuration
    relay_ipv6_example = panos.Dhcp("relay_ipv6_example",
        location={
            "template": {
                "name": example.name,
            },
        },
        name=eth2.name,
        relay={
            "ipv6": {
                "enabled": True,
                "servers": [
                    {
                        "name": "2001:db8::1",
                        "interface": eth1.name,
                    },
                    {
                        "name": "2001:db8::2",
                    },
                ],
            },
        })
    # DHCP Server configuration with various options
    server_example = panos.Dhcp("server_example",
        location={
            "template": {
                "name": example.name,
            },
        },
        name=eth3.name,
        server={
            "ip_pools": ["192.168.1.0/24"],
            "mode": "enabled",
            "option": {
                "dns": {
                    "primary": "8.8.8.8",
                    "secondary": "8.8.4.4",
                },
                "dns_suffix": "example.com",
                "gateway": "192.168.1.1",
                "lease": {
                    "timeout": 720,
                },
                "nis": {
                    "primary": "192.168.1.10",
                    "secondary": "192.168.1.11",
                },
                "ntp": {
                    "primary": "192.168.1.20",
                    "secondary": "192.168.1.21",
                },
                "pop3_server": "192.168.1.30",
                "smtp_server": "192.168.1.25",
                "subnet_mask": "255.255.255.0",
                "wins": {
                    "primary": "192.168.1.40",
                    "secondary": "192.168.1.41",
                },
                "user_defineds": [
                    {
                        "name": "custom_ip_option",
                        "code": 200,
                        "ips": [
                            "10.0.0.1",
                            "10.0.0.2",
                        ],
                        "inherited": False,
                    },
                    {
                        "name": "custom_ascii_option",
                        "code": 201,
                        "asciis": ["custom option"],
                        "inherited": False,
                    },
                    {
                        "name": "custom_hex_option",
                        "code": 202,
                        "hexes": ["0A0B0C"],
                        "inherited": False,
                    },
                ],
            },
            "reserveds": [{
                "name": "192.168.1.100",
                "mac": "00:11:22:33:44:55",
                "description": "reserved-printer",
            }],
        })
    # DHCP Server configuration with unlimited lease
    server_unlimited_lease_example = panos.Dhcp("server_unlimited_lease_example",
        location={
            "template": {
                "name": example.name,
            },
        },
        name=eth4.name,
        server={
            "ip_pools": ["192.168.2.0/24"],
            "option": {
                "lease": {
                    "unlimited": {},
                },
            },
        })
    # DHCP Server configuration with inheritance
    server_inheritance_example = panos.Dhcp("server_inheritance_example",
        location={
            "template": {
                "name": example.name,
            },
        },
        name=eth5.name,
        server={
            "ip_pools": ["192.168.3.0/24"],
            "option": {
                "inheritance": {
                    "source": eth1.name,
                },
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/panos/v2/panos"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Configure a template
    		example, err := panos.NewTemplate(ctx, "example", &panos.TemplateArgs{
    			Location: &panos.TemplateLocationArgs{
    				Panorama: &panos.TemplateLocationPanoramaArgs{},
    			},
    			Name: pulumi.String("example-template"),
    		})
    		if err != nil {
    			return err
    		}
    		// Configure ethernet interfaces
    		eth1, err := panos.NewEthernetInterface(ctx, "eth1", &panos.EthernetInterfaceArgs{
    			Location: &panos.EthernetInterfaceLocationArgs{
    				Template: &panos.EthernetInterfaceLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name:   pulumi.String("ethernet1/1"),
    			Layer3: &panos.EthernetInterfaceLayer3Args{},
    		})
    		if err != nil {
    			return err
    		}
    		eth2, err := panos.NewEthernetInterface(ctx, "eth2", &panos.EthernetInterfaceArgs{
    			Location: &panos.EthernetInterfaceLocationArgs{
    				Template: &panos.EthernetInterfaceLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name:   pulumi.String("ethernet1/2"),
    			Layer3: &panos.EthernetInterfaceLayer3Args{},
    		})
    		if err != nil {
    			return err
    		}
    		eth3, err := panos.NewEthernetInterface(ctx, "eth3", &panos.EthernetInterfaceArgs{
    			Location: &panos.EthernetInterfaceLocationArgs{
    				Template: &panos.EthernetInterfaceLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name:   pulumi.String("ethernet1/3"),
    			Layer3: &panos.EthernetInterfaceLayer3Args{},
    		})
    		if err != nil {
    			return err
    		}
    		eth4, err := panos.NewEthernetInterface(ctx, "eth4", &panos.EthernetInterfaceArgs{
    			Location: &panos.EthernetInterfaceLocationArgs{
    				Template: &panos.EthernetInterfaceLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name:   pulumi.String("ethernet1/4"),
    			Layer3: &panos.EthernetInterfaceLayer3Args{},
    		})
    		if err != nil {
    			return err
    		}
    		eth5, err := panos.NewEthernetInterface(ctx, "eth5", &panos.EthernetInterfaceArgs{
    			Location: &panos.EthernetInterfaceLocationArgs{
    				Template: &panos.EthernetInterfaceLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name:   pulumi.String("ethernet1/5"),
    			Layer3: &panos.EthernetInterfaceLayer3Args{},
    		})
    		if err != nil {
    			return err
    		}
    		// DHCP Relay configuration
    		_, err = panos.NewDhcp(ctx, "relay_example", &panos.DhcpArgs{
    			Location: &panos.DhcpLocationArgs{
    				Template: &panos.DhcpLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name: eth1.Name,
    			Relay: &panos.DhcpRelayArgs{
    				Ip: &panos.DhcpRelayIpArgs{
    					Enabled: pulumi.Bool(true),
    					Servers: pulumi.StringArray{
    						pulumi.String("10.0.0.1"),
    						pulumi.String("10.0.0.2"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// DHCP Relay IPv6 configuration
    		_, err = panos.NewDhcp(ctx, "relay_ipv6_example", &panos.DhcpArgs{
    			Location: &panos.DhcpLocationArgs{
    				Template: &panos.DhcpLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name: eth2.Name,
    			Relay: &panos.DhcpRelayArgs{
    				Ipv6: &panos.DhcpRelayIpv6Args{
    					Enabled: pulumi.Bool(true),
    					Servers: panos.DhcpRelayIpv6ServerArray{
    						&panos.DhcpRelayIpv6ServerArgs{
    							Name:      pulumi.String("2001:db8::1"),
    							Interface: eth1.Name,
    						},
    						&panos.DhcpRelayIpv6ServerArgs{
    							Name: pulumi.String("2001:db8::2"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// DHCP Server configuration with various options
    		_, err = panos.NewDhcp(ctx, "server_example", &panos.DhcpArgs{
    			Location: &panos.DhcpLocationArgs{
    				Template: &panos.DhcpLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name: eth3.Name,
    			Server: &panos.DhcpServerArgs{
    				IpPools: pulumi.StringArray{
    					pulumi.String("192.168.1.0/24"),
    				},
    				Mode: pulumi.String("enabled"),
    				Option: &panos.DhcpServerOptionArgs{
    					Dns: &panos.DhcpServerOptionDnsArgs{
    						Primary:   pulumi.String("8.8.8.8"),
    						Secondary: pulumi.String("8.8.4.4"),
    					},
    					DnsSuffix: pulumi.String("example.com"),
    					Gateway:   pulumi.String("192.168.1.1"),
    					Lease: &panos.DhcpServerOptionLeaseArgs{
    						Timeout: pulumi.Float64(720),
    					},
    					Nis: &panos.DhcpServerOptionNisArgs{
    						Primary:   pulumi.String("192.168.1.10"),
    						Secondary: pulumi.String("192.168.1.11"),
    					},
    					Ntp: &panos.DhcpServerOptionNtpArgs{
    						Primary:   pulumi.String("192.168.1.20"),
    						Secondary: pulumi.String("192.168.1.21"),
    					},
    					Pop3Server: pulumi.String("192.168.1.30"),
    					SmtpServer: pulumi.String("192.168.1.25"),
    					SubnetMask: pulumi.String("255.255.255.0"),
    					Wins: &panos.DhcpServerOptionWinsArgs{
    						Primary:   pulumi.String("192.168.1.40"),
    						Secondary: pulumi.String("192.168.1.41"),
    					},
    					UserDefineds: panos.DhcpServerOptionUserDefinedArray{
    						&panos.DhcpServerOptionUserDefinedArgs{
    							Name: pulumi.String("custom_ip_option"),
    							Code: pulumi.Float64(200),
    							Ips: pulumi.StringArray{
    								pulumi.String("10.0.0.1"),
    								pulumi.String("10.0.0.2"),
    							},
    							Inherited: pulumi.Bool(false),
    						},
    						&panos.DhcpServerOptionUserDefinedArgs{
    							Name: pulumi.String("custom_ascii_option"),
    							Code: pulumi.Float64(201),
    							Asciis: pulumi.StringArray{
    								pulumi.String("custom option"),
    							},
    							Inherited: pulumi.Bool(false),
    						},
    						&panos.DhcpServerOptionUserDefinedArgs{
    							Name: pulumi.String("custom_hex_option"),
    							Code: pulumi.Float64(202),
    							Hexes: pulumi.StringArray{
    								pulumi.String("0A0B0C"),
    							},
    							Inherited: pulumi.Bool(false),
    						},
    					},
    				},
    				Reserveds: panos.DhcpServerReservedArray{
    					&panos.DhcpServerReservedArgs{
    						Name:        pulumi.String("192.168.1.100"),
    						Mac:         pulumi.String("00:11:22:33:44:55"),
    						Description: pulumi.String("reserved-printer"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// DHCP Server configuration with unlimited lease
    		_, err = panos.NewDhcp(ctx, "server_unlimited_lease_example", &panos.DhcpArgs{
    			Location: &panos.DhcpLocationArgs{
    				Template: &panos.DhcpLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name: eth4.Name,
    			Server: &panos.DhcpServerArgs{
    				IpPools: pulumi.StringArray{
    					pulumi.String("192.168.2.0/24"),
    				},
    				Option: &panos.DhcpServerOptionArgs{
    					Lease: &panos.DhcpServerOptionLeaseArgs{
    						Unlimited: &panos.DhcpServerOptionLeaseUnlimitedArgs{},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// DHCP Server configuration with inheritance
    		_, err = panos.NewDhcp(ctx, "server_inheritance_example", &panos.DhcpArgs{
    			Location: &panos.DhcpLocationArgs{
    				Template: &panos.DhcpLocationTemplateArgs{
    					Name: example.Name,
    				},
    			},
    			Name: eth5.Name,
    			Server: &panos.DhcpServerArgs{
    				IpPools: pulumi.StringArray{
    					pulumi.String("192.168.3.0/24"),
    				},
    				Option: &panos.DhcpServerOptionArgs{
    					Inheritance: &panos.DhcpServerOptionInheritanceArgs{
    						Source: eth1.Name,
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Panos = Pulumi.Panos;
    
    return await Deployment.RunAsync(() => 
    {
        // Configure a template
        var example = new Panos.Template("example", new()
        {
            Location = new Panos.Inputs.TemplateLocationArgs
            {
                Panorama = null,
            },
            Name = "example-template",
        });
    
        // Configure ethernet interfaces
        var eth1 = new Panos.EthernetInterface("eth1", new()
        {
            Location = new Panos.Inputs.EthernetInterfaceLocationArgs
            {
                Template = new Panos.Inputs.EthernetInterfaceLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = "ethernet1/1",
            Layer3 = null,
        });
    
        var eth2 = new Panos.EthernetInterface("eth2", new()
        {
            Location = new Panos.Inputs.EthernetInterfaceLocationArgs
            {
                Template = new Panos.Inputs.EthernetInterfaceLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = "ethernet1/2",
            Layer3 = null,
        });
    
        var eth3 = new Panos.EthernetInterface("eth3", new()
        {
            Location = new Panos.Inputs.EthernetInterfaceLocationArgs
            {
                Template = new Panos.Inputs.EthernetInterfaceLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = "ethernet1/3",
            Layer3 = null,
        });
    
        var eth4 = new Panos.EthernetInterface("eth4", new()
        {
            Location = new Panos.Inputs.EthernetInterfaceLocationArgs
            {
                Template = new Panos.Inputs.EthernetInterfaceLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = "ethernet1/4",
            Layer3 = null,
        });
    
        var eth5 = new Panos.EthernetInterface("eth5", new()
        {
            Location = new Panos.Inputs.EthernetInterfaceLocationArgs
            {
                Template = new Panos.Inputs.EthernetInterfaceLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = "ethernet1/5",
            Layer3 = null,
        });
    
        // DHCP Relay configuration
        var relayExample = new Panos.Dhcp("relay_example", new()
        {
            Location = new Panos.Inputs.DhcpLocationArgs
            {
                Template = new Panos.Inputs.DhcpLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = eth1.Name,
            Relay = new Panos.Inputs.DhcpRelayArgs
            {
                Ip = new Panos.Inputs.DhcpRelayIpArgs
                {
                    Enabled = true,
                    Servers = new[]
                    {
                        "10.0.0.1",
                        "10.0.0.2",
                    },
                },
            },
        });
    
        // DHCP Relay IPv6 configuration
        var relayIpv6Example = new Panos.Dhcp("relay_ipv6_example", new()
        {
            Location = new Panos.Inputs.DhcpLocationArgs
            {
                Template = new Panos.Inputs.DhcpLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = eth2.Name,
            Relay = new Panos.Inputs.DhcpRelayArgs
            {
                Ipv6 = new Panos.Inputs.DhcpRelayIpv6Args
                {
                    Enabled = true,
                    Servers = new[]
                    {
                        new Panos.Inputs.DhcpRelayIpv6ServerArgs
                        {
                            Name = "2001:db8::1",
                            Interface = eth1.Name,
                        },
                        new Panos.Inputs.DhcpRelayIpv6ServerArgs
                        {
                            Name = "2001:db8::2",
                        },
                    },
                },
            },
        });
    
        // DHCP Server configuration with various options
        var serverExample = new Panos.Dhcp("server_example", new()
        {
            Location = new Panos.Inputs.DhcpLocationArgs
            {
                Template = new Panos.Inputs.DhcpLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = eth3.Name,
            Server = new Panos.Inputs.DhcpServerArgs
            {
                IpPools = new[]
                {
                    "192.168.1.0/24",
                },
                Mode = "enabled",
                Option = new Panos.Inputs.DhcpServerOptionArgs
                {
                    Dns = new Panos.Inputs.DhcpServerOptionDnsArgs
                    {
                        Primary = "8.8.8.8",
                        Secondary = "8.8.4.4",
                    },
                    DnsSuffix = "example.com",
                    Gateway = "192.168.1.1",
                    Lease = new Panos.Inputs.DhcpServerOptionLeaseArgs
                    {
                        Timeout = 720,
                    },
                    Nis = new Panos.Inputs.DhcpServerOptionNisArgs
                    {
                        Primary = "192.168.1.10",
                        Secondary = "192.168.1.11",
                    },
                    Ntp = new Panos.Inputs.DhcpServerOptionNtpArgs
                    {
                        Primary = "192.168.1.20",
                        Secondary = "192.168.1.21",
                    },
                    Pop3Server = "192.168.1.30",
                    SmtpServer = "192.168.1.25",
                    SubnetMask = "255.255.255.0",
                    Wins = new Panos.Inputs.DhcpServerOptionWinsArgs
                    {
                        Primary = "192.168.1.40",
                        Secondary = "192.168.1.41",
                    },
                    UserDefineds = new[]
                    {
                        new Panos.Inputs.DhcpServerOptionUserDefinedArgs
                        {
                            Name = "custom_ip_option",
                            Code = 200,
                            Ips = new[]
                            {
                                "10.0.0.1",
                                "10.0.0.2",
                            },
                            Inherited = false,
                        },
                        new Panos.Inputs.DhcpServerOptionUserDefinedArgs
                        {
                            Name = "custom_ascii_option",
                            Code = 201,
                            Asciis = new[]
                            {
                                "custom option",
                            },
                            Inherited = false,
                        },
                        new Panos.Inputs.DhcpServerOptionUserDefinedArgs
                        {
                            Name = "custom_hex_option",
                            Code = 202,
                            Hexes = new[]
                            {
                                "0A0B0C",
                            },
                            Inherited = false,
                        },
                    },
                },
                Reserveds = new[]
                {
                    new Panos.Inputs.DhcpServerReservedArgs
                    {
                        Name = "192.168.1.100",
                        Mac = "00:11:22:33:44:55",
                        Description = "reserved-printer",
                    },
                },
            },
        });
    
        // DHCP Server configuration with unlimited lease
        var serverUnlimitedLeaseExample = new Panos.Dhcp("server_unlimited_lease_example", new()
        {
            Location = new Panos.Inputs.DhcpLocationArgs
            {
                Template = new Panos.Inputs.DhcpLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = eth4.Name,
            Server = new Panos.Inputs.DhcpServerArgs
            {
                IpPools = new[]
                {
                    "192.168.2.0/24",
                },
                Option = new Panos.Inputs.DhcpServerOptionArgs
                {
                    Lease = new Panos.Inputs.DhcpServerOptionLeaseArgs
                    {
                        Unlimited = null,
                    },
                },
            },
        });
    
        // DHCP Server configuration with inheritance
        var serverInheritanceExample = new Panos.Dhcp("server_inheritance_example", new()
        {
            Location = new Panos.Inputs.DhcpLocationArgs
            {
                Template = new Panos.Inputs.DhcpLocationTemplateArgs
                {
                    Name = example.Name,
                },
            },
            Name = eth5.Name,
            Server = new Panos.Inputs.DhcpServerArgs
            {
                IpPools = new[]
                {
                    "192.168.3.0/24",
                },
                Option = new Panos.Inputs.DhcpServerOptionArgs
                {
                    Inheritance = new Panos.Inputs.DhcpServerOptionInheritanceArgs
                    {
                        Source = eth1.Name,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.panos.Template;
    import com.pulumi.panos.TemplateArgs;
    import com.pulumi.panos.inputs.TemplateLocationArgs;
    import com.pulumi.panos.inputs.TemplateLocationPanoramaArgs;
    import com.pulumi.panos.EthernetInterface;
    import com.pulumi.panos.EthernetInterfaceArgs;
    import com.pulumi.panos.inputs.EthernetInterfaceLocationArgs;
    import com.pulumi.panos.inputs.EthernetInterfaceLocationTemplateArgs;
    import com.pulumi.panos.inputs.EthernetInterfaceLayer3Args;
    import com.pulumi.panos.Dhcp;
    import com.pulumi.panos.DhcpArgs;
    import com.pulumi.panos.inputs.DhcpLocationArgs;
    import com.pulumi.panos.inputs.DhcpLocationTemplateArgs;
    import com.pulumi.panos.inputs.DhcpRelayArgs;
    import com.pulumi.panos.inputs.DhcpRelayIpArgs;
    import com.pulumi.panos.inputs.DhcpRelayIpv6Args;
    import com.pulumi.panos.inputs.DhcpServerArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionDnsArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionLeaseArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionNisArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionNtpArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionWinsArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionLeaseUnlimitedArgs;
    import com.pulumi.panos.inputs.DhcpServerOptionInheritanceArgs;
    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) {
            // Configure a template
            var example = new Template("example", TemplateArgs.builder()
                .location(TemplateLocationArgs.builder()
                    .panorama(TemplateLocationPanoramaArgs.builder()
                        .build())
                    .build())
                .name("example-template")
                .build());
    
            // Configure ethernet interfaces
            var eth1 = new EthernetInterface("eth1", EthernetInterfaceArgs.builder()
                .location(EthernetInterfaceLocationArgs.builder()
                    .template(EthernetInterfaceLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name("ethernet1/1")
                .layer3(EthernetInterfaceLayer3Args.builder()
                    .build())
                .build());
    
            var eth2 = new EthernetInterface("eth2", EthernetInterfaceArgs.builder()
                .location(EthernetInterfaceLocationArgs.builder()
                    .template(EthernetInterfaceLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name("ethernet1/2")
                .layer3(EthernetInterfaceLayer3Args.builder()
                    .build())
                .build());
    
            var eth3 = new EthernetInterface("eth3", EthernetInterfaceArgs.builder()
                .location(EthernetInterfaceLocationArgs.builder()
                    .template(EthernetInterfaceLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name("ethernet1/3")
                .layer3(EthernetInterfaceLayer3Args.builder()
                    .build())
                .build());
    
            var eth4 = new EthernetInterface("eth4", EthernetInterfaceArgs.builder()
                .location(EthernetInterfaceLocationArgs.builder()
                    .template(EthernetInterfaceLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name("ethernet1/4")
                .layer3(EthernetInterfaceLayer3Args.builder()
                    .build())
                .build());
    
            var eth5 = new EthernetInterface("eth5", EthernetInterfaceArgs.builder()
                .location(EthernetInterfaceLocationArgs.builder()
                    .template(EthernetInterfaceLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name("ethernet1/5")
                .layer3(EthernetInterfaceLayer3Args.builder()
                    .build())
                .build());
    
            // DHCP Relay configuration
            var relayExample = new Dhcp("relayExample", DhcpArgs.builder()
                .location(DhcpLocationArgs.builder()
                    .template(DhcpLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name(eth1.name())
                .relay(DhcpRelayArgs.builder()
                    .ip(DhcpRelayIpArgs.builder()
                        .enabled(true)
                        .servers(                    
                            "10.0.0.1",
                            "10.0.0.2")
                        .build())
                    .build())
                .build());
    
            // DHCP Relay IPv6 configuration
            var relayIpv6Example = new Dhcp("relayIpv6Example", DhcpArgs.builder()
                .location(DhcpLocationArgs.builder()
                    .template(DhcpLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name(eth2.name())
                .relay(DhcpRelayArgs.builder()
                    .ipv6(DhcpRelayIpv6Args.builder()
                        .enabled(true)
                        .servers(                    
                            DhcpRelayIpv6ServerArgs.builder()
                                .name("2001:db8::1")
                                .interface_(eth1.name())
                                .build(),
                            DhcpRelayIpv6ServerArgs.builder()
                                .name("2001:db8::2")
                                .build())
                        .build())
                    .build())
                .build());
    
            // DHCP Server configuration with various options
            var serverExample = new Dhcp("serverExample", DhcpArgs.builder()
                .location(DhcpLocationArgs.builder()
                    .template(DhcpLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name(eth3.name())
                .server(DhcpServerArgs.builder()
                    .ipPools("192.168.1.0/24")
                    .mode("enabled")
                    .option(DhcpServerOptionArgs.builder()
                        .dns(DhcpServerOptionDnsArgs.builder()
                            .primary("8.8.8.8")
                            .secondary("8.8.4.4")
                            .build())
                        .dnsSuffix("example.com")
                        .gateway("192.168.1.1")
                        .lease(DhcpServerOptionLeaseArgs.builder()
                            .timeout(720.0)
                            .build())
                        .nis(DhcpServerOptionNisArgs.builder()
                            .primary("192.168.1.10")
                            .secondary("192.168.1.11")
                            .build())
                        .ntp(DhcpServerOptionNtpArgs.builder()
                            .primary("192.168.1.20")
                            .secondary("192.168.1.21")
                            .build())
                        .pop3Server("192.168.1.30")
                        .smtpServer("192.168.1.25")
                        .subnetMask("255.255.255.0")
                        .wins(DhcpServerOptionWinsArgs.builder()
                            .primary("192.168.1.40")
                            .secondary("192.168.1.41")
                            .build())
                        .userDefineds(                    
                            DhcpServerOptionUserDefinedArgs.builder()
                                .name("custom_ip_option")
                                .code(200.0)
                                .ips(                            
                                    "10.0.0.1",
                                    "10.0.0.2")
                                .inherited(false)
                                .build(),
                            DhcpServerOptionUserDefinedArgs.builder()
                                .name("custom_ascii_option")
                                .code(201.0)
                                .asciis("custom option")
                                .inherited(false)
                                .build(),
                            DhcpServerOptionUserDefinedArgs.builder()
                                .name("custom_hex_option")
                                .code(202.0)
                                .hexes("0A0B0C")
                                .inherited(false)
                                .build())
                        .build())
                    .reserveds(DhcpServerReservedArgs.builder()
                        .name("192.168.1.100")
                        .mac("00:11:22:33:44:55")
                        .description("reserved-printer")
                        .build())
                    .build())
                .build());
    
            // DHCP Server configuration with unlimited lease
            var serverUnlimitedLeaseExample = new Dhcp("serverUnlimitedLeaseExample", DhcpArgs.builder()
                .location(DhcpLocationArgs.builder()
                    .template(DhcpLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name(eth4.name())
                .server(DhcpServerArgs.builder()
                    .ipPools("192.168.2.0/24")
                    .option(DhcpServerOptionArgs.builder()
                        .lease(DhcpServerOptionLeaseArgs.builder()
                            .unlimited(DhcpServerOptionLeaseUnlimitedArgs.builder()
                                .build())
                            .build())
                        .build())
                    .build())
                .build());
    
            // DHCP Server configuration with inheritance
            var serverInheritanceExample = new Dhcp("serverInheritanceExample", DhcpArgs.builder()
                .location(DhcpLocationArgs.builder()
                    .template(DhcpLocationTemplateArgs.builder()
                        .name(example.name())
                        .build())
                    .build())
                .name(eth5.name())
                .server(DhcpServerArgs.builder()
                    .ipPools("192.168.3.0/24")
                    .option(DhcpServerOptionArgs.builder()
                        .inheritance(DhcpServerOptionInheritanceArgs.builder()
                            .source(eth1.name())
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Configure a template
      example:
        type: panos:Template
        properties:
          location:
            panorama: {}
          name: example-template
      # Configure ethernet interfaces
      eth1:
        type: panos:EthernetInterface
        properties:
          location:
            template:
              name: ${example.name}
          name: ethernet1/1
          layer3: {}
      eth2:
        type: panos:EthernetInterface
        properties:
          location:
            template:
              name: ${example.name}
          name: ethernet1/2
          layer3: {}
      eth3:
        type: panos:EthernetInterface
        properties:
          location:
            template:
              name: ${example.name}
          name: ethernet1/3
          layer3: {}
      eth4:
        type: panos:EthernetInterface
        properties:
          location:
            template:
              name: ${example.name}
          name: ethernet1/4
          layer3: {}
      eth5:
        type: panos:EthernetInterface
        properties:
          location:
            template:
              name: ${example.name}
          name: ethernet1/5
          layer3: {}
      # DHCP Relay configuration
      relayExample:
        type: panos:Dhcp
        name: relay_example
        properties:
          location:
            template:
              name: ${example.name}
          name: ${eth1.name}
          relay:
            ip:
              enabled: true
              servers:
                - 10.0.0.1
                - 10.0.0.2
      # DHCP Relay IPv6 configuration
      relayIpv6Example:
        type: panos:Dhcp
        name: relay_ipv6_example
        properties:
          location:
            template:
              name: ${example.name}
          name: ${eth2.name}
          relay:
            ipv6:
              enabled: true
              servers:
                - name: 2001:db8::1
                  interface: ${eth1.name}
                - name: 2001:db8::2
      # DHCP Server configuration with various options
      serverExample:
        type: panos:Dhcp
        name: server_example
        properties:
          location:
            template:
              name: ${example.name}
          name: ${eth3.name}
          server:
            ipPools:
              - 192.168.1.0/24
            mode: enabled
            option:
              dns:
                primary: 8.8.8.8
                secondary: 8.8.4.4
              dnsSuffix: example.com
              gateway: 192.168.1.1
              lease:
                timeout: 720
              nis:
                primary: 192.168.1.10
                secondary: 192.168.1.11
              ntp:
                primary: 192.168.1.20
                secondary: 192.168.1.21
              pop3Server: 192.168.1.30
              smtpServer: 192.168.1.25
              subnetMask: 255.255.255.0
              wins:
                primary: 192.168.1.40
                secondary: 192.168.1.41
              userDefineds:
                - name: custom_ip_option
                  code: 200
                  ips:
                    - 10.0.0.1
                    - 10.0.0.2
                  inherited: false
                - name: custom_ascii_option
                  code: 201
                  asciis:
                    - custom option
                  inherited: false
                - name: custom_hex_option
                  code: 202
                  hexes:
                    - 0A0B0C
                  inherited: false
            reserveds:
              - name: 192.168.1.100
                mac: 00:11:22:33:44:55
                description: reserved-printer
      # DHCP Server configuration with unlimited lease
      serverUnlimitedLeaseExample:
        type: panos:Dhcp
        name: server_unlimited_lease_example
        properties:
          location:
            template:
              name: ${example.name}
          name: ${eth4.name}
          server:
            ipPools:
              - 192.168.2.0/24
            option:
              lease:
                unlimited: {}
      # DHCP Server configuration with inheritance
      serverInheritanceExample:
        type: panos:Dhcp
        name: server_inheritance_example
        properties:
          location:
            template:
              name: ${example.name}
          name: ${eth5.name}
          server:
            ipPools:
              - 192.168.3.0/24
            option:
              inheritance:
                source: ${eth1.name}
    

    Create Dhcp Resource

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

    Constructor syntax

    new Dhcp(name: string, args: DhcpArgs, opts?: CustomResourceOptions);
    @overload
    def Dhcp(resource_name: str,
             args: DhcpArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Dhcp(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             location: Optional[DhcpLocationArgs] = None,
             name: Optional[str] = None,
             relay: Optional[DhcpRelayArgs] = None,
             server: Optional[DhcpServerArgs] = None)
    func NewDhcp(ctx *Context, name string, args DhcpArgs, opts ...ResourceOption) (*Dhcp, error)
    public Dhcp(string name, DhcpArgs args, CustomResourceOptions? opts = null)
    public Dhcp(String name, DhcpArgs args)
    public Dhcp(String name, DhcpArgs args, CustomResourceOptions options)
    
    type: panos:Dhcp
    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 DhcpArgs
    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 DhcpArgs
    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 DhcpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DhcpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DhcpArgs
    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 dhcpResource = new Panos.Dhcp("dhcpResource", new()
    {
        Location = new Panos.Inputs.DhcpLocationArgs
        {
            Ngfw = new Panos.Inputs.DhcpLocationNgfwArgs
            {
                NgfwDevice = "string",
            },
            Template = new Panos.Inputs.DhcpLocationTemplateArgs
            {
                Name = "string",
                NgfwDevice = "string",
                PanoramaDevice = "string",
            },
            TemplateStack = new Panos.Inputs.DhcpLocationTemplateStackArgs
            {
                Name = "string",
                NgfwDevice = "string",
                PanoramaDevice = "string",
            },
        },
        Name = "string",
        Relay = new Panos.Inputs.DhcpRelayArgs
        {
            Ip = new Panos.Inputs.DhcpRelayIpArgs
            {
                Enabled = false,
                Servers = new[]
                {
                    "string",
                },
            },
            Ipv6 = new Panos.Inputs.DhcpRelayIpv6Args
            {
                Enabled = false,
                Servers = new[]
                {
                    new Panos.Inputs.DhcpRelayIpv6ServerArgs
                    {
                        Name = "string",
                        Interface = "string",
                    },
                },
            },
        },
        Server = new Panos.Inputs.DhcpServerArgs
        {
            IpPools = new[]
            {
                "string",
            },
            Mode = "string",
            Option = new Panos.Inputs.DhcpServerOptionArgs
            {
                Dns = new Panos.Inputs.DhcpServerOptionDnsArgs
                {
                    Primary = "string",
                    Secondary = "string",
                },
                DnsSuffix = "string",
                Gateway = "string",
                Inheritance = new Panos.Inputs.DhcpServerOptionInheritanceArgs
                {
                    Source = "string",
                },
                Lease = new Panos.Inputs.DhcpServerOptionLeaseArgs
                {
                    Timeout = 0,
                    Unlimited = null,
                },
                Nis = new Panos.Inputs.DhcpServerOptionNisArgs
                {
                    Primary = "string",
                    Secondary = "string",
                },
                Ntp = new Panos.Inputs.DhcpServerOptionNtpArgs
                {
                    Primary = "string",
                    Secondary = "string",
                },
                Pop3Server = "string",
                SmtpServer = "string",
                SubnetMask = "string",
                UserDefineds = new[]
                {
                    new Panos.Inputs.DhcpServerOptionUserDefinedArgs
                    {
                        Name = "string",
                        Asciis = new[]
                        {
                            "string",
                        },
                        Code = 0,
                        Hexes = new[]
                        {
                            "string",
                        },
                        Inherited = false,
                        Ips = new[]
                        {
                            "string",
                        },
                        VendorClassIdentifier = "string",
                    },
                },
                Wins = new Panos.Inputs.DhcpServerOptionWinsArgs
                {
                    Primary = "string",
                    Secondary = "string",
                },
            },
            ProbeIp = false,
            Reserveds = new[]
            {
                new Panos.Inputs.DhcpServerReservedArgs
                {
                    Name = "string",
                    Description = "string",
                    Mac = "string",
                },
            },
        },
    });
    
    example, err := panos.NewDhcp(ctx, "dhcpResource", &panos.DhcpArgs{
    	Location: &panos.DhcpLocationArgs{
    		Ngfw: &panos.DhcpLocationNgfwArgs{
    			NgfwDevice: pulumi.String("string"),
    		},
    		Template: &panos.DhcpLocationTemplateArgs{
    			Name:           pulumi.String("string"),
    			NgfwDevice:     pulumi.String("string"),
    			PanoramaDevice: pulumi.String("string"),
    		},
    		TemplateStack: &panos.DhcpLocationTemplateStackArgs{
    			Name:           pulumi.String("string"),
    			NgfwDevice:     pulumi.String("string"),
    			PanoramaDevice: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	Relay: &panos.DhcpRelayArgs{
    		Ip: &panos.DhcpRelayIpArgs{
    			Enabled: pulumi.Bool(false),
    			Servers: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    		Ipv6: &panos.DhcpRelayIpv6Args{
    			Enabled: pulumi.Bool(false),
    			Servers: panos.DhcpRelayIpv6ServerArray{
    				&panos.DhcpRelayIpv6ServerArgs{
    					Name:      pulumi.String("string"),
    					Interface: pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Server: &panos.DhcpServerArgs{
    		IpPools: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		Mode: pulumi.String("string"),
    		Option: &panos.DhcpServerOptionArgs{
    			Dns: &panos.DhcpServerOptionDnsArgs{
    				Primary:   pulumi.String("string"),
    				Secondary: pulumi.String("string"),
    			},
    			DnsSuffix: pulumi.String("string"),
    			Gateway:   pulumi.String("string"),
    			Inheritance: &panos.DhcpServerOptionInheritanceArgs{
    				Source: pulumi.String("string"),
    			},
    			Lease: &panos.DhcpServerOptionLeaseArgs{
    				Timeout:   pulumi.Float64(0),
    				Unlimited: &panos.DhcpServerOptionLeaseUnlimitedArgs{},
    			},
    			Nis: &panos.DhcpServerOptionNisArgs{
    				Primary:   pulumi.String("string"),
    				Secondary: pulumi.String("string"),
    			},
    			Ntp: &panos.DhcpServerOptionNtpArgs{
    				Primary:   pulumi.String("string"),
    				Secondary: pulumi.String("string"),
    			},
    			Pop3Server: pulumi.String("string"),
    			SmtpServer: pulumi.String("string"),
    			SubnetMask: pulumi.String("string"),
    			UserDefineds: panos.DhcpServerOptionUserDefinedArray{
    				&panos.DhcpServerOptionUserDefinedArgs{
    					Name: pulumi.String("string"),
    					Asciis: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Code: pulumi.Float64(0),
    					Hexes: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Inherited: pulumi.Bool(false),
    					Ips: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					VendorClassIdentifier: pulumi.String("string"),
    				},
    			},
    			Wins: &panos.DhcpServerOptionWinsArgs{
    				Primary:   pulumi.String("string"),
    				Secondary: pulumi.String("string"),
    			},
    		},
    		ProbeIp: pulumi.Bool(false),
    		Reserveds: panos.DhcpServerReservedArray{
    			&panos.DhcpServerReservedArgs{
    				Name:        pulumi.String("string"),
    				Description: pulumi.String("string"),
    				Mac:         pulumi.String("string"),
    			},
    		},
    	},
    })
    
    var dhcpResource = new Dhcp("dhcpResource", DhcpArgs.builder()
        .location(DhcpLocationArgs.builder()
            .ngfw(DhcpLocationNgfwArgs.builder()
                .ngfwDevice("string")
                .build())
            .template(DhcpLocationTemplateArgs.builder()
                .name("string")
                .ngfwDevice("string")
                .panoramaDevice("string")
                .build())
            .templateStack(DhcpLocationTemplateStackArgs.builder()
                .name("string")
                .ngfwDevice("string")
                .panoramaDevice("string")
                .build())
            .build())
        .name("string")
        .relay(DhcpRelayArgs.builder()
            .ip(DhcpRelayIpArgs.builder()
                .enabled(false)
                .servers("string")
                .build())
            .ipv6(DhcpRelayIpv6Args.builder()
                .enabled(false)
                .servers(DhcpRelayIpv6ServerArgs.builder()
                    .name("string")
                    .interface_("string")
                    .build())
                .build())
            .build())
        .server(DhcpServerArgs.builder()
            .ipPools("string")
            .mode("string")
            .option(DhcpServerOptionArgs.builder()
                .dns(DhcpServerOptionDnsArgs.builder()
                    .primary("string")
                    .secondary("string")
                    .build())
                .dnsSuffix("string")
                .gateway("string")
                .inheritance(DhcpServerOptionInheritanceArgs.builder()
                    .source("string")
                    .build())
                .lease(DhcpServerOptionLeaseArgs.builder()
                    .timeout(0.0)
                    .unlimited(DhcpServerOptionLeaseUnlimitedArgs.builder()
                        .build())
                    .build())
                .nis(DhcpServerOptionNisArgs.builder()
                    .primary("string")
                    .secondary("string")
                    .build())
                .ntp(DhcpServerOptionNtpArgs.builder()
                    .primary("string")
                    .secondary("string")
                    .build())
                .pop3Server("string")
                .smtpServer("string")
                .subnetMask("string")
                .userDefineds(DhcpServerOptionUserDefinedArgs.builder()
                    .name("string")
                    .asciis("string")
                    .code(0.0)
                    .hexes("string")
                    .inherited(false)
                    .ips("string")
                    .vendorClassIdentifier("string")
                    .build())
                .wins(DhcpServerOptionWinsArgs.builder()
                    .primary("string")
                    .secondary("string")
                    .build())
                .build())
            .probeIp(false)
            .reserveds(DhcpServerReservedArgs.builder()
                .name("string")
                .description("string")
                .mac("string")
                .build())
            .build())
        .build());
    
    dhcp_resource = panos.Dhcp("dhcpResource",
        location={
            "ngfw": {
                "ngfw_device": "string",
            },
            "template": {
                "name": "string",
                "ngfw_device": "string",
                "panorama_device": "string",
            },
            "template_stack": {
                "name": "string",
                "ngfw_device": "string",
                "panorama_device": "string",
            },
        },
        name="string",
        relay={
            "ip": {
                "enabled": False,
                "servers": ["string"],
            },
            "ipv6": {
                "enabled": False,
                "servers": [{
                    "name": "string",
                    "interface": "string",
                }],
            },
        },
        server={
            "ip_pools": ["string"],
            "mode": "string",
            "option": {
                "dns": {
                    "primary": "string",
                    "secondary": "string",
                },
                "dns_suffix": "string",
                "gateway": "string",
                "inheritance": {
                    "source": "string",
                },
                "lease": {
                    "timeout": 0,
                    "unlimited": {},
                },
                "nis": {
                    "primary": "string",
                    "secondary": "string",
                },
                "ntp": {
                    "primary": "string",
                    "secondary": "string",
                },
                "pop3_server": "string",
                "smtp_server": "string",
                "subnet_mask": "string",
                "user_defineds": [{
                    "name": "string",
                    "asciis": ["string"],
                    "code": 0,
                    "hexes": ["string"],
                    "inherited": False,
                    "ips": ["string"],
                    "vendor_class_identifier": "string",
                }],
                "wins": {
                    "primary": "string",
                    "secondary": "string",
                },
            },
            "probe_ip": False,
            "reserveds": [{
                "name": "string",
                "description": "string",
                "mac": "string",
            }],
        })
    
    const dhcpResource = new panos.Dhcp("dhcpResource", {
        location: {
            ngfw: {
                ngfwDevice: "string",
            },
            template: {
                name: "string",
                ngfwDevice: "string",
                panoramaDevice: "string",
            },
            templateStack: {
                name: "string",
                ngfwDevice: "string",
                panoramaDevice: "string",
            },
        },
        name: "string",
        relay: {
            ip: {
                enabled: false,
                servers: ["string"],
            },
            ipv6: {
                enabled: false,
                servers: [{
                    name: "string",
                    "interface": "string",
                }],
            },
        },
        server: {
            ipPools: ["string"],
            mode: "string",
            option: {
                dns: {
                    primary: "string",
                    secondary: "string",
                },
                dnsSuffix: "string",
                gateway: "string",
                inheritance: {
                    source: "string",
                },
                lease: {
                    timeout: 0,
                    unlimited: {},
                },
                nis: {
                    primary: "string",
                    secondary: "string",
                },
                ntp: {
                    primary: "string",
                    secondary: "string",
                },
                pop3Server: "string",
                smtpServer: "string",
                subnetMask: "string",
                userDefineds: [{
                    name: "string",
                    asciis: ["string"],
                    code: 0,
                    hexes: ["string"],
                    inherited: false,
                    ips: ["string"],
                    vendorClassIdentifier: "string",
                }],
                wins: {
                    primary: "string",
                    secondary: "string",
                },
            },
            probeIp: false,
            reserveds: [{
                name: "string",
                description: "string",
                mac: "string",
            }],
        },
    });
    
    type: panos:Dhcp
    properties:
        location:
            ngfw:
                ngfwDevice: string
            template:
                name: string
                ngfwDevice: string
                panoramaDevice: string
            templateStack:
                name: string
                ngfwDevice: string
                panoramaDevice: string
        name: string
        relay:
            ip:
                enabled: false
                servers:
                    - string
            ipv6:
                enabled: false
                servers:
                    - interface: string
                      name: string
        server:
            ipPools:
                - string
            mode: string
            option:
                dns:
                    primary: string
                    secondary: string
                dnsSuffix: string
                gateway: string
                inheritance:
                    source: string
                lease:
                    timeout: 0
                    unlimited: {}
                nis:
                    primary: string
                    secondary: string
                ntp:
                    primary: string
                    secondary: string
                pop3Server: string
                smtpServer: string
                subnetMask: string
                userDefineds:
                    - asciis:
                        - string
                      code: 0
                      hexes:
                        - string
                      inherited: false
                      ips:
                        - string
                      name: string
                      vendorClassIdentifier: string
                wins:
                    primary: string
                    secondary: string
            probeIp: false
            reserveds:
                - description: string
                  mac: string
                  name: string
    

    Dhcp 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 Dhcp resource accepts the following input properties:

    Location DhcpLocation
    The location of this object.
    Name string
    Relay DhcpRelay
    Server DhcpServer
    location DhcpLocation
    The location of this object.
    name String
    relay DhcpRelay
    server DhcpServer
    location DhcpLocation
    The location of this object.
    name string
    relay DhcpRelay
    server DhcpServer

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Dhcp 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 Existing Dhcp Resource

    Get an existing Dhcp 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?: DhcpState, opts?: CustomResourceOptions): Dhcp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            location: Optional[DhcpLocationArgs] = None,
            name: Optional[str] = None,
            relay: Optional[DhcpRelayArgs] = None,
            server: Optional[DhcpServerArgs] = None) -> Dhcp
    func GetDhcp(ctx *Context, name string, id IDInput, state *DhcpState, opts ...ResourceOption) (*Dhcp, error)
    public static Dhcp Get(string name, Input<string> id, DhcpState? state, CustomResourceOptions? opts = null)
    public static Dhcp get(String name, Output<String> id, DhcpState state, CustomResourceOptions options)
    resources:  _:    type: panos:Dhcp    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:
    Location DhcpLocation
    The location of this object.
    Name string
    Relay DhcpRelay
    Server DhcpServer
    location DhcpLocation
    The location of this object.
    name String
    relay DhcpRelay
    server DhcpServer
    location DhcpLocation
    The location of this object.
    name string
    relay DhcpRelay
    server DhcpServer

    Supporting Types

    DhcpLocation, DhcpLocationArgs

    Ngfw DhcpLocationNgfw
    Located in a specific NGFW device
    Template DhcpLocationTemplate
    Located in a specific template
    TemplateStack DhcpLocationTemplateStack
    Located in a specific template stack
    Ngfw DhcpLocationNgfw
    Located in a specific NGFW device
    Template DhcpLocationTemplate
    Located in a specific template
    TemplateStack DhcpLocationTemplateStack
    Located in a specific template stack
    ngfw DhcpLocationNgfw
    Located in a specific NGFW device
    template DhcpLocationTemplate
    Located in a specific template
    templateStack DhcpLocationTemplateStack
    Located in a specific template stack
    ngfw DhcpLocationNgfw
    Located in a specific NGFW device
    template DhcpLocationTemplate
    Located in a specific template
    templateStack DhcpLocationTemplateStack
    Located in a specific template stack
    ngfw DhcpLocationNgfw
    Located in a specific NGFW device
    template DhcpLocationTemplate
    Located in a specific template
    template_stack DhcpLocationTemplateStack
    Located in a specific template stack
    ngfw Property Map
    Located in a specific NGFW device
    template Property Map
    Located in a specific template
    templateStack Property Map
    Located in a specific template stack

    DhcpLocationNgfw, DhcpLocationNgfwArgs

    NgfwDevice string
    The NGFW device
    NgfwDevice string
    The NGFW device
    ngfwDevice String
    The NGFW device
    ngfwDevice string
    The NGFW device
    ngfw_device str
    The NGFW device
    ngfwDevice String
    The NGFW device

    DhcpLocationTemplate, DhcpLocationTemplateArgs

    Name string
    Specific Panorama template
    NgfwDevice string
    The NGFW device
    PanoramaDevice string
    Specific Panorama device
    Name string
    Specific Panorama template
    NgfwDevice string
    The NGFW device
    PanoramaDevice string
    Specific Panorama device
    name String
    Specific Panorama template
    ngfwDevice String
    The NGFW device
    panoramaDevice String
    Specific Panorama device
    name string
    Specific Panorama template
    ngfwDevice string
    The NGFW device
    panoramaDevice string
    Specific Panorama device
    name str
    Specific Panorama template
    ngfw_device str
    The NGFW device
    panorama_device str
    Specific Panorama device
    name String
    Specific Panorama template
    ngfwDevice String
    The NGFW device
    panoramaDevice String
    Specific Panorama device

    DhcpLocationTemplateStack, DhcpLocationTemplateStackArgs

    Name string
    Specific Panorama template stack
    NgfwDevice string
    The NGFW device
    PanoramaDevice string
    Specific Panorama device
    Name string
    Specific Panorama template stack
    NgfwDevice string
    The NGFW device
    PanoramaDevice string
    Specific Panorama device
    name String
    Specific Panorama template stack
    ngfwDevice String
    The NGFW device
    panoramaDevice String
    Specific Panorama device
    name string
    Specific Panorama template stack
    ngfwDevice string
    The NGFW device
    panoramaDevice string
    Specific Panorama device
    name str
    Specific Panorama template stack
    ngfw_device str
    The NGFW device
    panorama_device str
    Specific Panorama device
    name String
    Specific Panorama template stack
    ngfwDevice String
    The NGFW device
    panoramaDevice String
    Specific Panorama device

    DhcpRelay, DhcpRelayArgs

    DhcpRelayIp, DhcpRelayIpArgs

    Enabled bool
    Servers List<string>
    Enabled bool
    Servers []string
    enabled Boolean
    servers List<String>
    enabled boolean
    servers string[]
    enabled bool
    servers Sequence[str]
    enabled Boolean
    servers List<String>

    DhcpRelayIpv6, DhcpRelayIpv6Args

    DhcpRelayIpv6Server, DhcpRelayIpv6ServerArgs

    Name string
    Interface string
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server
    Name string
    Interface string
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server
    name String
    interface_ String
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server
    name string
    interface string
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server
    name str
    interface str
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server
    name String
    interface String
    Specify outgoing interface when using an IPv6 multicast address for your DHCPv6 server

    DhcpServer, DhcpServerArgs

    IpPools List<string>
    Mode string
    Option DhcpServerOption
    ProbeIp bool
    Ping IP when allocating a new IP
    Reserveds List<DhcpServerReserved>
    IpPools []string
    Mode string
    Option DhcpServerOption
    ProbeIp bool
    Ping IP when allocating a new IP
    Reserveds []DhcpServerReserved
    ipPools List<String>
    mode String
    option DhcpServerOption
    probeIp Boolean
    Ping IP when allocating a new IP
    reserveds List<DhcpServerReserved>
    ipPools string[]
    mode string
    option DhcpServerOption
    probeIp boolean
    Ping IP when allocating a new IP
    reserveds DhcpServerReserved[]
    ip_pools Sequence[str]
    mode str
    option DhcpServerOption
    probe_ip bool
    Ping IP when allocating a new IP
    reserveds Sequence[DhcpServerReserved]
    ipPools List<String>
    mode String
    option Property Map
    probeIp Boolean
    Ping IP when allocating a new IP
    reserveds List<Property Map>

    DhcpServerOption, DhcpServerOptionArgs

    DhcpServerOptionDns, DhcpServerOptionDnsArgs

    Primary string
    DNS primary server ip address
    Secondary string
    DNS secondary server ip address
    Primary string
    DNS primary server ip address
    Secondary string
    DNS secondary server ip address
    primary String
    DNS primary server ip address
    secondary String
    DNS secondary server ip address
    primary string
    DNS primary server ip address
    secondary string
    DNS secondary server ip address
    primary str
    DNS primary server ip address
    secondary str
    DNS secondary server ip address
    primary String
    DNS primary server ip address
    secondary String
    DNS secondary server ip address

    DhcpServerOptionInheritance, DhcpServerOptionInheritanceArgs

    Source string
    Dynamic interface
    Source string
    Dynamic interface
    source String
    Dynamic interface
    source string
    Dynamic interface
    source str
    Dynamic interface
    source String
    Dynamic interface

    DhcpServerOptionLease, DhcpServerOptionLeaseArgs

    timeout Number
    lease(minute)
    unlimited Property Map

    DhcpServerOptionNis, DhcpServerOptionNisArgs

    Primary string
    NIS primary server ip address
    Secondary string
    NIS secondary server ip address
    Primary string
    NIS primary server ip address
    Secondary string
    NIS secondary server ip address
    primary String
    NIS primary server ip address
    secondary String
    NIS secondary server ip address
    primary string
    NIS primary server ip address
    secondary string
    NIS secondary server ip address
    primary str
    NIS primary server ip address
    secondary str
    NIS secondary server ip address
    primary String
    NIS primary server ip address
    secondary String
    NIS secondary server ip address

    DhcpServerOptionNtp, DhcpServerOptionNtpArgs

    Primary string
    NTP primary server ip address
    Secondary string
    NTP secondary server ip address
    Primary string
    NTP primary server ip address
    Secondary string
    NTP secondary server ip address
    primary String
    NTP primary server ip address
    secondary String
    NTP secondary server ip address
    primary string
    NTP primary server ip address
    secondary string
    NTP secondary server ip address
    primary str
    NTP primary server ip address
    secondary str
    NTP secondary server ip address
    primary String
    NTP primary server ip address
    secondary String
    NTP secondary server ip address

    DhcpServerOptionUserDefined, DhcpServerOptionUserDefinedArgs

    Name string
    Asciis List<string>
    Code double
    option code
    Hexes List<string>
    Inherited bool
    Inherited from DHCP server inheritance source
    Ips List<string>
    VendorClassIdentifier string
    Name string
    Asciis []string
    Code float64
    option code
    Hexes []string
    Inherited bool
    Inherited from DHCP server inheritance source
    Ips []string
    VendorClassIdentifier string
    name String
    asciis List<String>
    code Double
    option code
    hexes List<String>
    inherited Boolean
    Inherited from DHCP server inheritance source
    ips List<String>
    vendorClassIdentifier String
    name string
    asciis string[]
    code number
    option code
    hexes string[]
    inherited boolean
    Inherited from DHCP server inheritance source
    ips string[]
    vendorClassIdentifier string
    name str
    asciis Sequence[str]
    code float
    option code
    hexes Sequence[str]
    inherited bool
    Inherited from DHCP server inheritance source
    ips Sequence[str]
    vendor_class_identifier str
    name String
    asciis List<String>
    code Number
    option code
    hexes List<String>
    inherited Boolean
    Inherited from DHCP server inheritance source
    ips List<String>
    vendorClassIdentifier String

    DhcpServerOptionWins, DhcpServerOptionWinsArgs

    Primary string
    WINS primary server ip address
    Secondary string
    WINS secondary server ip address
    Primary string
    WINS primary server ip address
    Secondary string
    WINS secondary server ip address
    primary String
    WINS primary server ip address
    secondary String
    WINS secondary server ip address
    primary string
    WINS primary server ip address
    secondary string
    WINS secondary server ip address
    primary str
    WINS primary server ip address
    secondary str
    WINS secondary server ip address
    primary String
    WINS primary server ip address
    secondary String
    WINS secondary server ip address

    DhcpServerReserved, DhcpServerReservedArgs

    Name string
    Description string
    Description of reserved entry, e.g. host name
    Mac string
    MAC address (format xx:xx:xx:xx:xx:xx)
    Name string
    Description string
    Description of reserved entry, e.g. host name
    Mac string
    MAC address (format xx:xx:xx:xx:xx:xx)
    name String
    description String
    Description of reserved entry, e.g. host name
    mac String
    MAC address (format xx:xx:xx:xx:xx:xx)
    name string
    description string
    Description of reserved entry, e.g. host name
    mac string
    MAC address (format xx:xx:xx:xx:xx:xx)
    name str
    description str
    Description of reserved entry, e.g. host name
    mac str
    MAC address (format xx:xx:xx:xx:xx:xx)
    name String
    description String
    Description of reserved entry, e.g. host name
    mac String
    MAC address (format xx:xx:xx:xx:xx:xx)

    Package Details

    Repository
    panos paloaltonetworks/terraform-provider-panos
    License
    Notes
    This Pulumi package is based on the panos Terraform Provider.
    panos logo
    panos 2.0.6 published on Wednesday, Nov 19, 2025 by paloaltonetworks
      Meet Neo: Your AI Platform Teammate