oci.Core.getDhcpOptions
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testDhcpOptions = oci.Core.getDhcpOptions({
    compartmentId: compartmentId,
    displayName: dhcpOptionsDisplayName,
    state: dhcpOptionsState,
    vcnId: testVcn.id,
});
import pulumi
import pulumi_oci as oci
test_dhcp_options = oci.Core.get_dhcp_options(compartment_id=compartment_id,
    display_name=dhcp_options_display_name,
    state=dhcp_options_state,
    vcn_id=test_vcn["id"])
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.GetDhcpOptions(ctx, &core.GetDhcpOptionsArgs{
			CompartmentId: compartmentId,
			DisplayName:   pulumi.StringRef(dhcpOptionsDisplayName),
			State:         pulumi.StringRef(dhcpOptionsState),
			VcnId:         pulumi.StringRef(testVcn.Id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testDhcpOptions = Oci.Core.GetDhcpOptions.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = dhcpOptionsDisplayName,
        State = dhcpOptionsState,
        VcnId = testVcn.Id,
    });
});
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(compartmentId)
            .displayName(dhcpOptionsDisplayName)
            .state(dhcpOptionsState)
            .vcnId(testVcn.id())
            .build());
    }
}
variables:
  testDhcpOptions:
    fn::invoke:
      function: oci:Core:getDhcpOptions
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${dhcpOptionsDisplayName}
        state: ${dhcpOptionsState}
        vcnId: ${testVcn.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[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[GetDhcpOptionsFilterArgs]]]] = None,
                     state: Optional[pulumi.Input[str]] = None,
                     vcn_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetDhcpOptionsResult]func LookupDhcpOptions(ctx *Context, args *LookupDhcpOptionsArgs, opts ...InvokeOption) (*LookupDhcpOptionsResult, error)
func LookupDhcpOptionsOutput(ctx *Context, args *LookupDhcpOptionsOutputArgs, opts ...InvokeOption) LookupDhcpOptionsResultOutput> Note: This function is named LookupDhcpOptions 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)
public static Output<GetDhcpOptionsResult> getDhcpOptions(GetDhcpOptionsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Core/getDhcpOptions:getDhcpOptions
  arguments:
    # arguments dictionaryThe 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<GetDhcp Options Filter> 
- 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
[]GetDhcp Options Filter 
- 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<GetDhcp Options Filter> 
- 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
GetDhcp Options Filter[] 
- 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
Sequence[GetDhcp Options Filter] 
- 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<GetDhcp Options Option> 
- 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<GetDhcp Options Filter> 
- 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
[]GetDhcp Options Option 
- 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
[]GetDhcp Options Filter 
- 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<GetDhcp Options Option> 
- 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<GetDhcp Options Filter> 
- 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
GetDhcp Options Option[] 
- 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
GetDhcp Options Filter[] 
- 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
Sequence[GetDhcp Options Option] 
- 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
Sequence[GetDhcp Options Filter] 
- 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   
GetDhcpOptionsOption   
- CompartmentId string
- The OCID of the compartment.
- Dictionary<string, string>
- 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.
- DomainName stringType 
- The search domain name type of DHCP options
- Dictionary<string, string>
- 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<GetDhcp Options Option Option> 
- 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.
- map[string]string
- 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.
- DomainName stringType 
- The search domain name type of DHCP options
- map[string]string
- 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
[]GetDhcp Options Option Option 
- 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.
- Map<String,String>
- 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.
- domainName StringType 
- The search domain name type of DHCP options
- Map<String,String>
- 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<GetDhcp Options Option Option> 
- 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.
- {[key: string]: string}
- 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.
- domainName stringType 
- The search domain name type of DHCP options
- {[key: string]: string}
- 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
GetDhcp Options Option Option[] 
- 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.
- Mapping[str, str]
- 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_ strtype 
- The search domain name type of DHCP options
- Mapping[str, str]
- 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
Sequence[GetDhcp Options Option Option] 
- 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.
- Map<String>
- 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.
- domainName StringType 
- The search domain name type of DHCP options
- Map<String>
- 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    
- CustomDns List<string>Servers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- SearchDomain List<string>Names 
- 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) orSearchDomain(for DhcpSearchDomainOption).
- CustomDns []stringServers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- SearchDomain []stringNames 
- 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) orSearchDomain(for DhcpSearchDomainOption).
- customDns List<String>Servers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- searchDomain List<String>Names 
- 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) orSearchDomain(for DhcpSearchDomainOption).
- customDns string[]Servers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- searchDomain string[]Names 
- 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) orSearchDomain(for DhcpSearchDomainOption).
- custom_dns_ Sequence[str]servers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- search_domain_ Sequence[str]names 
- 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) orSearchDomain(for DhcpSearchDomainOption).
- customDns List<String>Servers 
- If you set serverTypetoCustomDnsServer, specify the IP address of at least one DNS server of your choice (three maximum).
- searchDomain List<String>Names 
- 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) orSearchDomain(for DhcpSearchDomainOption).
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.