1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. DhcpOptions
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Core.DhcpOptions

Explore with Pulumi AI

This resource provides the Dhcp Options resource in Oracle Cloud Infrastructure Core service.

Creates a new set of DHCP options for the specified VCN. For more information, see DhcpOptions.

For the purposes of access control, you must provide the OCID of the compartment where you want the set of DHCP options to reside. Notice that the set of options doesn’t have to be in the same compartment as the VCN, subnets, or other Networking Service components. If you’re not sure which compartment to use, put the set of DHCP options in the same compartment as the VCN. For more information about compartments and access control, see Overview of the IAM Service. For information about OCIDs, see Resource Identifiers.

You may optionally specify a display name for the set of DHCP options, otherwise a default is provided. It does not have to be unique, and you can change it. Avoid entering confidential information.

For more information on configuring a VCN’s default DHCP options, see Managing Default VCN Resources

Example Usage

VCN Local with Internet

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testDhcpOptions = new oci.core.DhcpOptions("test_dhcp_options", {
    compartmentId: compartmentId,
    options: [
        {
            type: "DomainNameServer",
            serverType: "VcnLocalPlusInternet",
        },
        {
            type: "SearchDomain",
            searchDomainNames: ["test.com"],
        },
    ],
    vcnId: testVcn.id,
    displayName: dhcpOptionsDisplayName,
});
Copy
import pulumi
import pulumi_oci as oci

test_dhcp_options = oci.core.DhcpOptions("test_dhcp_options",
    compartment_id=compartment_id,
    options=[
        {
            "type": "DomainNameServer",
            "server_type": "VcnLocalPlusInternet",
        },
        {
            "type": "SearchDomain",
            "search_domain_names": ["test.com"],
        },
    ],
    vcn_id=test_vcn["id"],
    display_name=dhcp_options_display_name)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.NewDhcpOptions(ctx, "test_dhcp_options", &core.DhcpOptionsArgs{
			CompartmentId: pulumi.Any(compartmentId),
			Options: core.DhcpOptionsOptionArray{
				&core.DhcpOptionsOptionArgs{
					Type:       pulumi.String("DomainNameServer"),
					ServerType: pulumi.String("VcnLocalPlusInternet"),
				},
				&core.DhcpOptionsOptionArgs{
					Type: pulumi.String("SearchDomain"),
					SearchDomainNames: pulumi.StringArray{
						pulumi.String("test.com"),
					},
				},
			},
			VcnId:       pulumi.Any(testVcn.Id),
			DisplayName: pulumi.Any(dhcpOptionsDisplayName),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testDhcpOptions = new Oci.Core.DhcpOptions("test_dhcp_options", new()
    {
        CompartmentId = compartmentId,
        Options = new[]
        {
            new Oci.Core.Inputs.DhcpOptionsOptionArgs
            {
                Type = "DomainNameServer",
                ServerType = "VcnLocalPlusInternet",
            },
            new Oci.Core.Inputs.DhcpOptionsOptionArgs
            {
                Type = "SearchDomain",
                SearchDomainNames = new[]
                {
                    "test.com",
                },
            },
        },
        VcnId = testVcn.Id,
        DisplayName = dhcpOptionsDisplayName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.DhcpOptions;
import com.pulumi.oci.Core.DhcpOptionsArgs;
import com.pulumi.oci.Core.inputs.DhcpOptionsOptionArgs;
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 testDhcpOptions = new DhcpOptions("testDhcpOptions", DhcpOptionsArgs.builder()
            .compartmentId(compartmentId)
            .options(            
                DhcpOptionsOptionArgs.builder()
                    .type("DomainNameServer")
                    .serverType("VcnLocalPlusInternet")
                    .build(),
                DhcpOptionsOptionArgs.builder()
                    .type("SearchDomain")
                    .searchDomainNames("test.com")
                    .build())
            .vcnId(testVcn.id())
            .displayName(dhcpOptionsDisplayName)
            .build());

    }
}
Copy
resources:
  testDhcpOptions:
    type: oci:Core:DhcpOptions
    name: test_dhcp_options
    properties:
      compartmentId: ${compartmentId}
      options:
        - type: DomainNameServer
          serverType: VcnLocalPlusInternet
        - type: SearchDomain
          searchDomainNames:
            - test.com
      vcnId: ${testVcn.id}
      displayName: ${dhcpOptionsDisplayName}
Copy

Custom DNS Server

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testDhcpOptions = new oci.core.DhcpOptions("test_dhcp_options", {
    compartmentId: compartmentId,
    options: [
        {
            type: "DomainNameServer",
            serverType: "CustomDnsServer",
            customDnsServers: [
                "192.168.0.2",
                "192.168.0.11",
                "192.168.0.19",
            ],
        },
        {
            type: "SearchDomain",
            searchDomainNames: ["test.com"],
        },
    ],
    vcnId: testVcn.id,
    definedTags: {
        "Operations.CostCenter": "42",
    },
    displayName: dhcpOptionsDisplayName,
    domainNameType: dhcpOptionsDomainNameType,
    freeformTags: {
        Department: "Finance",
    },
});
Copy
import pulumi
import pulumi_oci as oci

test_dhcp_options = oci.core.DhcpOptions("test_dhcp_options",
    compartment_id=compartment_id,
    options=[
        {
            "type": "DomainNameServer",
            "server_type": "CustomDnsServer",
            "custom_dns_servers": [
                "192.168.0.2",
                "192.168.0.11",
                "192.168.0.19",
            ],
        },
        {
            "type": "SearchDomain",
            "search_domain_names": ["test.com"],
        },
    ],
    vcn_id=test_vcn["id"],
    defined_tags={
        "Operations.CostCenter": "42",
    },
    display_name=dhcp_options_display_name,
    domain_name_type=dhcp_options_domain_name_type,
    freeform_tags={
        "Department": "Finance",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.NewDhcpOptions(ctx, "test_dhcp_options", &core.DhcpOptionsArgs{
			CompartmentId: pulumi.Any(compartmentId),
			Options: core.DhcpOptionsOptionArray{
				&core.DhcpOptionsOptionArgs{
					Type:       pulumi.String("DomainNameServer"),
					ServerType: pulumi.String("CustomDnsServer"),
					CustomDnsServers: pulumi.StringArray{
						pulumi.String("192.168.0.2"),
						pulumi.String("192.168.0.11"),
						pulumi.String("192.168.0.19"),
					},
				},
				&core.DhcpOptionsOptionArgs{
					Type: pulumi.String("SearchDomain"),
					SearchDomainNames: pulumi.StringArray{
						pulumi.String("test.com"),
					},
				},
			},
			VcnId: pulumi.Any(testVcn.Id),
			DefinedTags: pulumi.StringMap{
				"Operations.CostCenter": pulumi.String("42"),
			},
			DisplayName:    pulumi.Any(dhcpOptionsDisplayName),
			DomainNameType: pulumi.Any(dhcpOptionsDomainNameType),
			FreeformTags: pulumi.StringMap{
				"Department": pulumi.String("Finance"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testDhcpOptions = new Oci.Core.DhcpOptions("test_dhcp_options", new()
    {
        CompartmentId = compartmentId,
        Options = new[]
        {
            new Oci.Core.Inputs.DhcpOptionsOptionArgs
            {
                Type = "DomainNameServer",
                ServerType = "CustomDnsServer",
                CustomDnsServers = new[]
                {
                    "192.168.0.2",
                    "192.168.0.11",
                    "192.168.0.19",
                },
            },
            new Oci.Core.Inputs.DhcpOptionsOptionArgs
            {
                Type = "SearchDomain",
                SearchDomainNames = new[]
                {
                    "test.com",
                },
            },
        },
        VcnId = testVcn.Id,
        DefinedTags = 
        {
            { "Operations.CostCenter", "42" },
        },
        DisplayName = dhcpOptionsDisplayName,
        DomainNameType = dhcpOptionsDomainNameType,
        FreeformTags = 
        {
            { "Department", "Finance" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.DhcpOptions;
import com.pulumi.oci.Core.DhcpOptionsArgs;
import com.pulumi.oci.Core.inputs.DhcpOptionsOptionArgs;
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 testDhcpOptions = new DhcpOptions("testDhcpOptions", DhcpOptionsArgs.builder()
            .compartmentId(compartmentId)
            .options(            
                DhcpOptionsOptionArgs.builder()
                    .type("DomainNameServer")
                    .serverType("CustomDnsServer")
                    .customDnsServers(                    
                        "192.168.0.2",
                        "192.168.0.11",
                        "192.168.0.19")
                    .build(),
                DhcpOptionsOptionArgs.builder()
                    .type("SearchDomain")
                    .searchDomainNames("test.com")
                    .build())
            .vcnId(testVcn.id())
            .definedTags(Map.of("Operations.CostCenter", "42"))
            .displayName(dhcpOptionsDisplayName)
            .domainNameType(dhcpOptionsDomainNameType)
            .freeformTags(Map.of("Department", "Finance"))
            .build());

    }
}
Copy
resources:
  testDhcpOptions:
    type: oci:Core:DhcpOptions
    name: test_dhcp_options
    properties:
      compartmentId: ${compartmentId}
      options:
        - type: DomainNameServer
          serverType: CustomDnsServer
          customDnsServers:
            - 192.168.0.2
            - 192.168.0.11
            - 192.168.0.19
        - type: SearchDomain
          searchDomainNames:
            - test.com
      vcnId: ${testVcn.id}
      definedTags:
        Operations.CostCenter: '42'
      displayName: ${dhcpOptionsDisplayName}
      domainNameType: ${dhcpOptionsDomainNameType}
      freeformTags:
        Department: Finance
Copy

Create DhcpOptions Resource

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

Constructor syntax

new DhcpOptions(name: string, args: DhcpOptionsArgs, opts?: CustomResourceOptions);
@overload
def DhcpOptions(resource_name: str,
                args: DhcpOptionsArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def DhcpOptions(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                compartment_id: Optional[str] = None,
                options: Optional[Sequence[_core.DhcpOptionsOptionArgs]] = None,
                vcn_id: Optional[str] = None,
                defined_tags: Optional[Mapping[str, str]] = None,
                display_name: Optional[str] = None,
                domain_name_type: Optional[str] = None,
                freeform_tags: Optional[Mapping[str, str]] = None)
func NewDhcpOptions(ctx *Context, name string, args DhcpOptionsArgs, opts ...ResourceOption) (*DhcpOptions, error)
public DhcpOptions(string name, DhcpOptionsArgs args, CustomResourceOptions? opts = null)
public DhcpOptions(String name, DhcpOptionsArgs args)
public DhcpOptions(String name, DhcpOptionsArgs args, CustomResourceOptions options)
type: oci:Core:DhcpOptions
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 This property is required. DhcpOptionsArgs
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 This property is required. DhcpOptionsArgs
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 This property is required. DhcpOptionsArgs
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 This property is required. DhcpOptionsArgs
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. DhcpOptionsArgs
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 dhcpOptionsResource = new Oci.Core.DhcpOptions("dhcpOptionsResource", new()
{
    CompartmentId = "string",
    Options = new[]
    {
        new Oci.Core.Inputs.DhcpOptionsOptionArgs
        {
            Type = "string",
            CustomDnsServers = new[]
            {
                "string",
            },
            SearchDomainNames = new[]
            {
                "string",
            },
            ServerType = "string",
        },
    },
    VcnId = "string",
    DefinedTags = 
    {
        { "string", "string" },
    },
    DisplayName = "string",
    DomainNameType = "string",
    FreeformTags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := Core.NewDhcpOptions(ctx, "dhcpOptionsResource", &Core.DhcpOptionsArgs{
	CompartmentId: pulumi.String("string"),
	Options: core.DhcpOptionsOptionArray{
		&core.DhcpOptionsOptionArgs{
			Type: pulumi.String("string"),
			CustomDnsServers: pulumi.StringArray{
				pulumi.String("string"),
			},
			SearchDomainNames: pulumi.StringArray{
				pulumi.String("string"),
			},
			ServerType: pulumi.String("string"),
		},
	},
	VcnId: pulumi.String("string"),
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	DisplayName:    pulumi.String("string"),
	DomainNameType: pulumi.String("string"),
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var dhcpOptionsResource = new DhcpOptions("dhcpOptionsResource", DhcpOptionsArgs.builder()
    .compartmentId("string")
    .options(DhcpOptionsOptionArgs.builder()
        .type("string")
        .customDnsServers("string")
        .searchDomainNames("string")
        .serverType("string")
        .build())
    .vcnId("string")
    .definedTags(Map.of("string", "string"))
    .displayName("string")
    .domainNameType("string")
    .freeformTags(Map.of("string", "string"))
    .build());
Copy
dhcp_options_resource = oci.core.DhcpOptions("dhcpOptionsResource",
    compartment_id="string",
    options=[{
        "type": "string",
        "custom_dns_servers": ["string"],
        "search_domain_names": ["string"],
        "server_type": "string",
    }],
    vcn_id="string",
    defined_tags={
        "string": "string",
    },
    display_name="string",
    domain_name_type="string",
    freeform_tags={
        "string": "string",
    })
Copy
const dhcpOptionsResource = new oci.core.DhcpOptions("dhcpOptionsResource", {
    compartmentId: "string",
    options: [{
        type: "string",
        customDnsServers: ["string"],
        searchDomainNames: ["string"],
        serverType: "string",
    }],
    vcnId: "string",
    definedTags: {
        string: "string",
    },
    displayName: "string",
    domainNameType: "string",
    freeformTags: {
        string: "string",
    },
});
Copy
type: oci:Core:DhcpOptions
properties:
    compartmentId: string
    definedTags:
        string: string
    displayName: string
    domainNameType: string
    freeformTags:
        string: string
    options:
        - customDnsServers:
            - string
          searchDomainNames:
            - string
          serverType: string
          type: string
    vcnId: string
Copy

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

CompartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
Options This property is required. List<DhcpOptionsOption>
(Updatable) A set of DHCP options.
VcnId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

DefinedTags Dictionary<string, string>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
DomainNameType string
(Updatable) The search domain name type of DHCP options
FreeformTags Dictionary<string, string>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
CompartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
Options This property is required. []DhcpOptionsOptionArgs
(Updatable) A set of DHCP options.
VcnId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

DefinedTags map[string]string
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
DomainNameType string
(Updatable) The search domain name type of DHCP options
FreeformTags map[string]string
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
compartmentId This property is required. String
(Updatable) The OCID of the compartment to contain the set of DHCP options.
options This property is required. List<DhcpOptionsOption>
(Updatable) A set of DHCP options.
vcnId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<String,String>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType String
(Updatable) The search domain name type of DHCP options
freeformTags Map<String,String>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
compartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
options This property is required. DhcpOptionsOption[]
(Updatable) A set of DHCP options.
vcnId
This property is required.
Changes to this property will trigger replacement.
string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags {[key: string]: string}
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType string
(Updatable) The search domain name type of DHCP options
freeformTags {[key: string]: string}
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
compartment_id This property is required. str
(Updatable) The OCID of the compartment to contain the set of DHCP options.
options This property is required. Sequence[core.DhcpOptionsOptionArgs]
(Updatable) A set of DHCP options.
vcn_id
This property is required.
Changes to this property will trigger replacement.
str

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

defined_tags Mapping[str, str]
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name str
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domain_name_type str
(Updatable) The search domain name type of DHCP options
freeform_tags Mapping[str, str]
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
compartmentId This property is required. String
(Updatable) The OCID of the compartment to contain the set of DHCP options.
options This property is required. List<Property Map>
(Updatable) A set of DHCP options.
vcnId
This property is required.
Changes to this property will trigger replacement.
String

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<String>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType String
(Updatable) The search domain name type of DHCP options
freeformTags Map<String>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
State string
The current state of the set of DHCP options.
TimeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
Id string
The provider-assigned unique ID for this managed resource.
State string
The current state of the set of DHCP options.
TimeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
state String
The current state of the set of DHCP options.
timeCreated String
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id string
The provider-assigned unique ID for this managed resource.
state string
The current state of the set of DHCP options.
timeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id str
The provider-assigned unique ID for this managed resource.
state str
The current state of the set of DHCP options.
time_created str
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
state String
The current state of the set of DHCP options.
timeCreated String
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Look up Existing DhcpOptions Resource

Get an existing DhcpOptions 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?: DhcpOptionsState, opts?: CustomResourceOptions): DhcpOptions
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        display_name: Optional[str] = None,
        domain_name_type: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        options: Optional[Sequence[_core.DhcpOptionsOptionArgs]] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        vcn_id: Optional[str] = None) -> DhcpOptions
func GetDhcpOptions(ctx *Context, name string, id IDInput, state *DhcpOptionsState, opts ...ResourceOption) (*DhcpOptions, error)
public static DhcpOptions Get(string name, Input<string> id, DhcpOptionsState? state, CustomResourceOptions? opts = null)
public static DhcpOptions get(String name, Output<String> id, DhcpOptionsState state, CustomResourceOptions options)
resources:  _:    type: oci:Core:DhcpOptions    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:
CompartmentId string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
DefinedTags Dictionary<string, string>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
DomainNameType string
(Updatable) The search domain name type of DHCP options
FreeformTags Dictionary<string, string>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Options List<DhcpOptionsOption>
(Updatable) A set of DHCP options.
State string
The current state of the set of DHCP options.
TimeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId Changes to this property will trigger replacement. string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CompartmentId string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
DefinedTags map[string]string
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
DomainNameType string
(Updatable) The search domain name type of DHCP options
FreeformTags map[string]string
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Options []DhcpOptionsOptionArgs
(Updatable) A set of DHCP options.
State string
The current state of the set of DHCP options.
TimeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId Changes to this property will trigger replacement. string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId String
(Updatable) The OCID of the compartment to contain the set of DHCP options.
definedTags Map<String,String>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType String
(Updatable) The search domain name type of DHCP options
freeformTags Map<String,String>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
options List<DhcpOptionsOption>
(Updatable) A set of DHCP options.
state String
The current state of the set of DHCP options.
timeCreated String
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. String

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId string
(Updatable) The OCID of the compartment to contain the set of DHCP options.
definedTags {[key: string]: string}
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName string
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType string
(Updatable) The search domain name type of DHCP options
freeformTags {[key: string]: string}
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
options DhcpOptionsOption[]
(Updatable) A set of DHCP options.
state string
The current state of the set of DHCP options.
timeCreated string
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. string

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartment_id str
(Updatable) The OCID of the compartment to contain the set of DHCP options.
defined_tags Mapping[str, str]
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name str
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domain_name_type str
(Updatable) The search domain name type of DHCP options
freeform_tags Mapping[str, str]
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
options Sequence[core.DhcpOptionsOptionArgs]
(Updatable) A set of DHCP options.
state str
The current state of the set of DHCP options.
time_created str
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcn_id Changes to this property will trigger replacement. str

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

compartmentId String
(Updatable) The OCID of the compartment to contain the set of DHCP options.
definedTags Map<String>
(Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
domainNameType String
(Updatable) The search domain name type of DHCP options
freeformTags Map<String>
(Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
options List<Property Map>
(Updatable) A set of DHCP options.
state String
The current state of the set of DHCP options.
timeCreated String
Date and time the set of DHCP options was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. String

The OCID of the VCN the set of DHCP options belongs to.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Supporting Types

DhcpOptionsOption
, DhcpOptionsOptionArgs

Type This property is required. string
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
CustomDnsServers List<string>
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
SearchDomainNames List<string>

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

ServerType string
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).
Type This property is required. string
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
CustomDnsServers []string
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
SearchDomainNames []string

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

ServerType string
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).
type This property is required. String
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
customDnsServers List<String>
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
searchDomainNames List<String>

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

serverType String
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).
type This property is required. string
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
customDnsServers string[]
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
searchDomainNames string[]

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

serverType string
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).
type This property is required. str
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
custom_dns_servers Sequence[str]
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
search_domain_names Sequence[str]

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

server_type str
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).
type This property is required. String
(Updatable) The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).
customDnsServers List<String>
(Updatable) If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
searchDomainNames List<String>

(Updatable) A single search domain name according to RFC 952 and RFC 1123. During a DNS query, the OS will append this search domain name to the value being queried.

If you set DhcpDnsOption to VcnLocalPlusInternet, and you assign a DNS label to the VCN during creation, the search domain name in the VCN's default set of DHCP options is automatically set to the VCN domain (for example, vcn1.oraclevcn.com).

If you don't want to use a search domain name, omit this option from the set of DHCP options. Do not include this option with an empty list of search domain names, or with an empty string as the value for any search domain name.

serverType String
(Updatable)

  • VcnLocal: Reserved for future use.
  • VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver". Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see DNS in Your Virtual Cloud Network.
  • CustomDnsServer: Instances use a DNS server of your choice (three maximum).

Import

DhcpOptions can be imported using the id, e.g.

$ pulumi import oci:Core/dhcpOptions:DhcpOptions test_dhcp_options "id"
Copy

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

Package Details

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