1. Packages
  2. Cisco IOS XE Resource Provider
  3. API Docs
  4. Dhcp
Cisco IOS XE v0.0.1 published on Friday, Sep 22, 2023 by lbrlabs

iosxe.Dhcp

Explore with Pulumi AI

This resource can manage the DHCP configuration.

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.iosxe.Dhcp;
import com.pulumi.iosxe.DhcpArgs;
import com.pulumi.iosxe.inputs.DhcpSnoopingVlanArgs;
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 example = new Dhcp("example", DhcpArgs.builder()        
            .relayInformationOptionDefault(false)
            .relayInformationOptionVpn(true)
            .relayInformationTrustAll(false)
            .snooping(true)
            .snoopingVlans(DhcpSnoopingVlanArgs.builder()
                .vlan_id("3-4")
                .build())
            .build());

    }
}
Copy

Coming soon!

Coming soon!

resources:
  example:
    type: iosxe:Dhcp
    properties:
      relayInformationOptionDefault: false
      relayInformationOptionVpn: true
      relayInformationTrustAll: false
      snooping: true
      snoopingVlans:
        - vlan_id: 3-4
Copy

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: Optional[DhcpArgs] = None,
         opts: Optional[ResourceOptions] = None)

@overload
def Dhcp(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         compatibility_suboption_link_selection: Optional[str] = None,
         compatibility_suboption_server_override: Optional[str] = None,
         delete_mode: Optional[str] = None,
         device: Optional[str] = None,
         relay_information_option_default: Optional[bool] = None,
         relay_information_option_vpn: Optional[bool] = None,
         relay_information_trust_all: Optional[bool] = None,
         snooping: Optional[bool] = None,
         snooping_information_option_format_remote_id_hostname: Optional[bool] = None,
         snooping_vlans: Optional[Sequence[DhcpSnoopingVlanArgs]] = None)
func NewDhcp(ctx *Context, name string, args *DhcpArgs, opts ...ResourceOption) (*Dhcp, error)
public Dhcp(string name, DhcpArgs? args = null, CustomResourceOptions? opts = null)
public Dhcp(String name, DhcpArgs args)
public Dhcp(String name, DhcpArgs args, CustomResourceOptions options)
type: iosxe:Dhcp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 Iosxe.Dhcp("dhcpResource", new()
{
    CompatibilitySuboptionLinkSelection = "string",
    CompatibilitySuboptionServerOverride = "string",
    DeleteMode = "string",
    Device = "string",
    RelayInformationOptionDefault = false,
    RelayInformationOptionVpn = false,
    RelayInformationTrustAll = false,
    Snooping = false,
    SnoopingInformationOptionFormatRemoteIdHostname = false,
    SnoopingVlans = new[]
    {
        new Iosxe.Inputs.DhcpSnoopingVlanArgs
        {
            VlanId = "string",
        },
    },
});
Copy
example, err := iosxe.NewDhcp(ctx, "dhcpResource", &iosxe.DhcpArgs{
	CompatibilitySuboptionLinkSelection:  pulumi.String("string"),
	CompatibilitySuboptionServerOverride: pulumi.String("string"),
	DeleteMode:                           pulumi.String("string"),
	Device:                               pulumi.String("string"),
	RelayInformationOptionDefault:        pulumi.Bool(false),
	RelayInformationOptionVpn:            pulumi.Bool(false),
	RelayInformationTrustAll:             pulumi.Bool(false),
	Snooping:                             pulumi.Bool(false),
	SnoopingInformationOptionFormatRemoteIdHostname: pulumi.Bool(false),
	SnoopingVlans: iosxe.DhcpSnoopingVlanArray{
		&iosxe.DhcpSnoopingVlanArgs{
			VlanId: pulumi.String("string"),
		},
	},
})
Copy
var dhcpResource = new Dhcp("dhcpResource", DhcpArgs.builder()
    .compatibilitySuboptionLinkSelection("string")
    .compatibilitySuboptionServerOverride("string")
    .deleteMode("string")
    .device("string")
    .relayInformationOptionDefault(false)
    .relayInformationOptionVpn(false)
    .relayInformationTrustAll(false)
    .snooping(false)
    .snoopingInformationOptionFormatRemoteIdHostname(false)
    .snoopingVlans(DhcpSnoopingVlanArgs.builder()
        .vlanId("string")
        .build())
    .build());
Copy
dhcp_resource = iosxe.Dhcp("dhcpResource",
    compatibility_suboption_link_selection="string",
    compatibility_suboption_server_override="string",
    delete_mode="string",
    device="string",
    relay_information_option_default=False,
    relay_information_option_vpn=False,
    relay_information_trust_all=False,
    snooping=False,
    snooping_information_option_format_remote_id_hostname=False,
    snooping_vlans=[{
        "vlan_id": "string",
    }])
Copy
const dhcpResource = new iosxe.Dhcp("dhcpResource", {
    compatibilitySuboptionLinkSelection: "string",
    compatibilitySuboptionServerOverride: "string",
    deleteMode: "string",
    device: "string",
    relayInformationOptionDefault: false,
    relayInformationOptionVpn: false,
    relayInformationTrustAll: false,
    snooping: false,
    snoopingInformationOptionFormatRemoteIdHostname: false,
    snoopingVlans: [{
        vlanId: "string",
    }],
});
Copy
type: iosxe:Dhcp
properties:
    compatibilitySuboptionLinkSelection: string
    compatibilitySuboptionServerOverride: string
    deleteMode: string
    device: string
    relayInformationOptionDefault: false
    relayInformationOptionVpn: false
    relayInformationTrustAll: false
    snooping: false
    snoopingInformationOptionFormatRemoteIdHostname: false
    snoopingVlans:
        - vlanId: string
Copy

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:

CompatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
CompatibilitySuboptionServerOverride string
  • Choices: cisco, standard
DeleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
Device string
A device name from the provider configuration.
RelayInformationOptionDefault bool
Default option, no vpn
RelayInformationOptionVpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
RelayInformationTrustAll bool
Received DHCP packets may contain relay info option with zero giaddr
Snooping bool
DHCP Snooping
SnoopingInformationOptionFormatRemoteIdHostname bool
Use configured hostname for remote id
SnoopingVlans List<Lbrlabs.PulumiPackage.Iosxe.Inputs.DhcpSnoopingVlan>
DHCP Snooping vlan
CompatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
CompatibilitySuboptionServerOverride string
  • Choices: cisco, standard
DeleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
Device string
A device name from the provider configuration.
RelayInformationOptionDefault bool
Default option, no vpn
RelayInformationOptionVpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
RelayInformationTrustAll bool
Received DHCP packets may contain relay info option with zero giaddr
Snooping bool
DHCP Snooping
SnoopingInformationOptionFormatRemoteIdHostname bool
Use configured hostname for remote id
SnoopingVlans []DhcpSnoopingVlanArgs
DHCP Snooping vlan
compatibilitySuboptionLinkSelection String
  • Choices: cisco, standard
compatibilitySuboptionServerOverride String
  • Choices: cisco, standard
deleteMode String
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device String
A device name from the provider configuration.
relayInformationOptionDefault Boolean
Default option, no vpn
relayInformationOptionVpn Boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll Boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping Boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname Boolean
Use configured hostname for remote id
snoopingVlans List<DhcpSnoopingVlan>
DHCP Snooping vlan
compatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
compatibilitySuboptionServerOverride string
  • Choices: cisco, standard
deleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device string
A device name from the provider configuration.
relayInformationOptionDefault boolean
Default option, no vpn
relayInformationOptionVpn boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname boolean
Use configured hostname for remote id
snoopingVlans DhcpSnoopingVlan[]
DHCP Snooping vlan
compatibility_suboption_link_selection str
  • Choices: cisco, standard
compatibility_suboption_server_override str
  • Choices: cisco, standard
delete_mode str
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device str
A device name from the provider configuration.
relay_information_option_default bool
Default option, no vpn
relay_information_option_vpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
relay_information_trust_all bool
Received DHCP packets may contain relay info option with zero giaddr
snooping bool
DHCP Snooping
snooping_information_option_format_remote_id_hostname bool
Use configured hostname for remote id
snooping_vlans Sequence[DhcpSnoopingVlanArgs]
DHCP Snooping vlan
compatibilitySuboptionLinkSelection String
  • Choices: cisco, standard
compatibilitySuboptionServerOverride String
  • Choices: cisco, standard
deleteMode String
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device String
A device name from the provider configuration.
relayInformationOptionDefault Boolean
Default option, no vpn
relayInformationOptionVpn Boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll Boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping Boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname Boolean
Use configured hostname for remote id
snoopingVlans List<Property Map>
DHCP Snooping vlan

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,
        compatibility_suboption_link_selection: Optional[str] = None,
        compatibility_suboption_server_override: Optional[str] = None,
        delete_mode: Optional[str] = None,
        device: Optional[str] = None,
        relay_information_option_default: Optional[bool] = None,
        relay_information_option_vpn: Optional[bool] = None,
        relay_information_trust_all: Optional[bool] = None,
        snooping: Optional[bool] = None,
        snooping_information_option_format_remote_id_hostname: Optional[bool] = None,
        snooping_vlans: Optional[Sequence[DhcpSnoopingVlanArgs]] = 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: iosxe:Dhcp    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CompatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
CompatibilitySuboptionServerOverride string
  • Choices: cisco, standard
DeleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
Device string
A device name from the provider configuration.
RelayInformationOptionDefault bool
Default option, no vpn
RelayInformationOptionVpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
RelayInformationTrustAll bool
Received DHCP packets may contain relay info option with zero giaddr
Snooping bool
DHCP Snooping
SnoopingInformationOptionFormatRemoteIdHostname bool
Use configured hostname for remote id
SnoopingVlans List<Lbrlabs.PulumiPackage.Iosxe.Inputs.DhcpSnoopingVlan>
DHCP Snooping vlan
CompatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
CompatibilitySuboptionServerOverride string
  • Choices: cisco, standard
DeleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
Device string
A device name from the provider configuration.
RelayInformationOptionDefault bool
Default option, no vpn
RelayInformationOptionVpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
RelayInformationTrustAll bool
Received DHCP packets may contain relay info option with zero giaddr
Snooping bool
DHCP Snooping
SnoopingInformationOptionFormatRemoteIdHostname bool
Use configured hostname for remote id
SnoopingVlans []DhcpSnoopingVlanArgs
DHCP Snooping vlan
compatibilitySuboptionLinkSelection String
  • Choices: cisco, standard
compatibilitySuboptionServerOverride String
  • Choices: cisco, standard
deleteMode String
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device String
A device name from the provider configuration.
relayInformationOptionDefault Boolean
Default option, no vpn
relayInformationOptionVpn Boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll Boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping Boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname Boolean
Use configured hostname for remote id
snoopingVlans List<DhcpSnoopingVlan>
DHCP Snooping vlan
compatibilitySuboptionLinkSelection string
  • Choices: cisco, standard
compatibilitySuboptionServerOverride string
  • Choices: cisco, standard
deleteMode string
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device string
A device name from the provider configuration.
relayInformationOptionDefault boolean
Default option, no vpn
relayInformationOptionVpn boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname boolean
Use configured hostname for remote id
snoopingVlans DhcpSnoopingVlan[]
DHCP Snooping vlan
compatibility_suboption_link_selection str
  • Choices: cisco, standard
compatibility_suboption_server_override str
  • Choices: cisco, standard
delete_mode str
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device str
A device name from the provider configuration.
relay_information_option_default bool
Default option, no vpn
relay_information_option_vpn bool
Insert VPN sub-options and change the giaddr to the outgoing interface
relay_information_trust_all bool
Received DHCP packets may contain relay info option with zero giaddr
snooping bool
DHCP Snooping
snooping_information_option_format_remote_id_hostname bool
Use configured hostname for remote id
snooping_vlans Sequence[DhcpSnoopingVlanArgs]
DHCP Snooping vlan
compatibilitySuboptionLinkSelection String
  • Choices: cisco, standard
compatibilitySuboptionServerOverride String
  • Choices: cisco, standard
deleteMode String
Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is all. - Choices: all, attributes
device String
A device name from the provider configuration.
relayInformationOptionDefault Boolean
Default option, no vpn
relayInformationOptionVpn Boolean
Insert VPN sub-options and change the giaddr to the outgoing interface
relayInformationTrustAll Boolean
Received DHCP packets may contain relay info option with zero giaddr
snooping Boolean
DHCP Snooping
snoopingInformationOptionFormatRemoteIdHostname Boolean
Use configured hostname for remote id
snoopingVlans List<Property Map>
DHCP Snooping vlan

Supporting Types

DhcpSnoopingVlan
, DhcpSnoopingVlanArgs

VlanId This property is required. string
VlanId This property is required. string
vlanId This property is required. String
vlanId This property is required. string
vlan_id This property is required. str
vlanId This property is required. String

Import

 $ pulumi import iosxe:index/dhcp:Dhcp example "Cisco-IOS-XE-native:native/ip/dhcp"
Copy

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

Package Details

Repository
iosxe lbrlabs/pulumi-iosxe
License
Apache-2.0
Notes
This Pulumi package is based on the iosxe Terraform Provider.