oci logo
Oracle Cloud Infrastructure v0.12.0, Mar 17 23

oci.Core.getDhcpOptions

This data source provides the list of Dhcp Options in Oracle Cloud Infrastructure Core service.

Lists the sets of DHCP options in the specified VCN and specified compartment. If the VCN ID is not provided, then the list includes the sets of DHCP options from all VCNs in the specified compartment. The response includes the default set of options that automatically comes with each VCN, plus any other sets you’ve created.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testDhcpOptions = Oci.Core.GetDhcpOptions.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        DisplayName = @var.Dhcp_options_display_name,
        State = @var.Dhcp_options_state,
        VcnId = oci_core_vcn.Test_vcn.Id,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Core.GetDhcpOptions(ctx, &core.GetDhcpOptionsArgs{
			CompartmentId: _var.Compartment_id,
			DisplayName:   pulumi.StringRef(_var.Dhcp_options_display_name),
			State:         pulumi.StringRef(_var.Dhcp_options_state),
			VcnId:         pulumi.StringRef(oci_core_vcn.Test_vcn.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetDhcpOptionsArgs;
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) {
        final var testDhcpOptions = CoreFunctions.getDhcpOptions(GetDhcpOptionsArgs.builder()
            .compartmentId(var_.compartment_id())
            .displayName(var_.dhcp_options_display_name())
            .state(var_.dhcp_options_state())
            .vcnId(oci_core_vcn.test_vcn().id())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_dhcp_options = oci.Core.get_dhcp_options(compartment_id=var["compartment_id"],
    display_name=var["dhcp_options_display_name"],
    state=var["dhcp_options_state"],
    vcn_id=oci_core_vcn["test_vcn"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testDhcpOptions = oci.Core.getDhcpOptions({
    compartmentId: _var.compartment_id,
    displayName: _var.dhcp_options_display_name,
    state: _var.dhcp_options_state,
    vcnId: oci_core_vcn.test_vcn.id,
});
variables:
  testDhcpOptions:
    fn::invoke:
      Function: oci:Core:getDhcpOptions
      Arguments:
        compartmentId: ${var.compartment_id}
        displayName: ${var.dhcp_options_display_name}
        state: ${var.dhcp_options_state}
        vcnId: ${oci_core_vcn.test_vcn.id}

Using getDhcpOptions

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDhcpOptions(args: GetDhcpOptionsArgs, opts?: InvokeOptions): Promise<GetDhcpOptionsResult>
function getDhcpOptionsOutput(args: GetDhcpOptionsOutputArgs, opts?: InvokeOptions): Output<GetDhcpOptionsResult>
def get_dhcp_options(compartment_id: Optional[str] = None,
                     display_name: Optional[str] = None,
                     filters: Optional[Sequence[_core.GetDhcpOptionsFilter]] = None,
                     state: Optional[str] = None,
                     vcn_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetDhcpOptionsResult
def get_dhcp_options_output(compartment_id: Optional[pulumi.Input[str]] = None,
                     display_name: Optional[pulumi.Input[str]] = None,
                     filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetDhcpOptionsFilterArgs]]]] = None,
                     state: Optional[pulumi.Input[str]] = None,
                     vcn_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetDhcpOptionsResult]
func GetDhcpOptions(ctx *Context, args *GetDhcpOptionsArgs, opts ...InvokeOption) (*GetDhcpOptionsResult, error)
func GetDhcpOptionsOutput(ctx *Context, args *GetDhcpOptionsOutputArgs, opts ...InvokeOption) GetDhcpOptionsResultOutput

> Note: This function is named GetDhcpOptions in the Go SDK.

public static class GetDhcpOptions 
{
    public static Task<GetDhcpOptionsResult> InvokeAsync(GetDhcpOptionsArgs args, InvokeOptions? opts = null)
    public static Output<GetDhcpOptionsResult> Invoke(GetDhcpOptionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDhcpOptionsResult> getDhcpOptions(GetDhcpOptionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: oci:Core/getDhcpOptions:getDhcpOptions
  arguments:
    # arguments dictionary

The following arguments are supported:

CompartmentId string

The OCID of the compartment.

DisplayName string

A filter to return only resources that match the given display name exactly.

Filters List<GetDhcpOptionsFilter>
State string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

VcnId string

The OCID of the VCN.

CompartmentId string

The OCID of the compartment.

DisplayName string

A filter to return only resources that match the given display name exactly.

Filters []GetDhcpOptionsFilter
State string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

VcnId string

The OCID of the VCN.

compartmentId String

The OCID of the compartment.

displayName String

A filter to return only resources that match the given display name exactly.

filters List<GetDhcpOptionsFilter>
state String

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

vcnId String

The OCID of the VCN.

compartmentId string

The OCID of the compartment.

displayName string

A filter to return only resources that match the given display name exactly.

filters GetDhcpOptionsFilter[]
state string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

vcnId string

The OCID of the VCN.

compartment_id str

The OCID of the compartment.

display_name str

A filter to return only resources that match the given display name exactly.

filters GetDhcpOptionsFilter]
state str

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

vcn_id str

The OCID of the VCN.

compartmentId String

The OCID of the compartment.

displayName String

A filter to return only resources that match the given display name exactly.

filters List<Property Map>
state String

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

vcnId String

The OCID of the VCN.

getDhcpOptions Result

The following output properties are available:

CompartmentId string

The OCID of the compartment containing the set of DHCP options.

Id string

The provider-assigned unique ID for this managed resource.

Options List<GetDhcpOptionsOption>

The collection of individual DHCP options.

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Filters List<GetDhcpOptionsFilter>
State string

The current state of the set of DHCP options.

VcnId string

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

CompartmentId string

The OCID of the compartment containing the set of DHCP options.

Id string

The provider-assigned unique ID for this managed resource.

Options []GetDhcpOptionsOption

The collection of individual DHCP options.

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Filters []GetDhcpOptionsFilter
State string

The current state of the set of DHCP options.

VcnId string

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

compartmentId String

The OCID of the compartment containing the set of DHCP options.

id String

The provider-assigned unique ID for this managed resource.

options List<GetDhcpOptionsOption>

The collection of individual DHCP options.

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

filters List<GetDhcpOptionsFilter>
state String

The current state of the set of DHCP options.

vcnId String

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

compartmentId string

The OCID of the compartment containing the set of DHCP options.

id string

The provider-assigned unique ID for this managed resource.

options GetDhcpOptionsOption[]

The collection of individual DHCP options.

displayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

filters GetDhcpOptionsFilter[]
state string

The current state of the set of DHCP options.

vcnId string

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

compartment_id str

The OCID of the compartment containing the set of DHCP options.

id str

The provider-assigned unique ID for this managed resource.

options GetDhcpOptionsOption]

The collection of individual DHCP options.

display_name str

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

filters GetDhcpOptionsFilter]
state str

The current state of the set of DHCP options.

vcn_id str

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

compartmentId String

The OCID of the compartment containing the set of DHCP options.

id String

The provider-assigned unique ID for this managed resource.

options List<Property Map>

The collection of individual DHCP options.

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

filters List<Property Map>
state String

The current state of the set of DHCP options.

vcnId String

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

Supporting Types

GetDhcpOptionsFilter

Name string
Values List<string>
Regex bool
Name string
Values []string
Regex bool
name String
values List<String>
regex Boolean
name string
values string[]
regex boolean
name str
values Sequence[str]
regex bool
name String
values List<String>
regex Boolean

GetDhcpOptionsOption

CompartmentId string

The OCID of the compartment.

DefinedTags Dictionary<string, object>

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

A filter to return only resources that match the given display name exactly.

DomainNameType string

The search domain name type of DHCP options

FreeformTags Dictionary<string, object>

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"}

Id string

Oracle ID (OCID) for the set of DHCP options.

Options List<GetDhcpOptionsOptionOption>

The collection of individual DHCP options.

State string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 string

The OCID of the VCN.

CompartmentId string

The OCID of the compartment.

DefinedTags map[string]interface{}

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

A filter to return only resources that match the given display name exactly.

DomainNameType string

The search domain name type of DHCP options

FreeformTags map[string]interface{}

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"}

Id string

Oracle ID (OCID) for the set of DHCP options.

Options []GetDhcpOptionsOptionOption

The collection of individual DHCP options.

State string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 string

The OCID of the VCN.

compartmentId String

The OCID of the compartment.

definedTags Map<String,Object>

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

A filter to return only resources that match the given display name exactly.

domainNameType String

The search domain name type of DHCP options

freeformTags Map<String,Object>

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"}

id String

Oracle ID (OCID) for the set of DHCP options.

options List<GetDhcpOptionsOptionOption>

The collection of individual DHCP options.

state String

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 String

The OCID of the VCN.

compartmentId string

The OCID of the compartment.

definedTags {[key: string]: any}

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

A filter to return only resources that match the given display name exactly.

domainNameType string

The search domain name type of DHCP options

freeformTags {[key: string]: any}

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"}

id string

Oracle ID (OCID) for the set of DHCP options.

options GetDhcpOptionsOptionOption[]

The collection of individual DHCP options.

state string

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 string

The OCID of the VCN.

compartment_id str

The OCID of the compartment.

defined_tags Mapping[str, Any]

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

A filter to return only resources that match the given display name exactly.

domain_name_type str

The search domain name type of DHCP options

freeform_tags Mapping[str, Any]

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"}

id str

Oracle ID (OCID) for the set of DHCP options.

options GetDhcpOptionsOptionOption]

The collection of individual DHCP options.

state str

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 str

The OCID of the VCN.

compartmentId String

The OCID of the compartment.

definedTags Map<Any>

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

A filter to return only resources that match the given display name exactly.

domainNameType String

The search domain name type of DHCP options

freeformTags Map<Any>

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"}

id String

Oracle ID (OCID) for the set of DHCP options.

options List<Property Map>

The collection of individual DHCP options.

state String

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

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 String

The OCID of the VCN.

GetDhcpOptionsOptionOption

CustomDnsServers List<string>

If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).

SearchDomainNames List<string>

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.

ServerType string
  • 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 string

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

CustomDnsServers []string

If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).

SearchDomainNames []string

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.

ServerType string
  • 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 string

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

customDnsServers List<String>

If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).

searchDomainNames List<String>

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.

serverType String
  • 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 String

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

customDnsServers string[]

If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).

searchDomainNames string[]

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.

serverType string
  • 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 string

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

custom_dns_servers Sequence[str]

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]

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.

server_type str
  • 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 str

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

customDnsServers List<String>

If you set serverType to CustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).

searchDomainNames List<String>

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.

serverType String
  • 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 String

The specific DHCP option. Either DomainNameServer (for DhcpDnsOption) or SearchDomain (for DhcpSearchDomainOption).

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.