oci_core_dhcp_options

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

resource "oci_core_dhcp_options" "test_dhcp_options" {
	#Required
	compartment_id = var.compartment_id
	options {
        type = "DomainNameServer"
        server_type = "VcnLocalPlusInternet"
	}
	
    options {
        type = "SearchDomain"
        search_domain_names = [ "test.com" ]
    }
	
	vcn_id = oci_core_vcn.test_vcn.id

	#Optional
	display_name = var.dhcp_options_display_name
}

Custom DNS Server

resource "oci_core_dhcp_options" "test_dhcp_options" {
	#Required
	compartment_id = var.compartment_id
	options {
        type = "DomainNameServer"
        server_type = "CustomDnsServer"
        custom_dns_servers = [ "192.168.0.2", "192.168.0.11", "192.168.0.19" ]
	}
	
    options {
        type = "SearchDomain"
        search_domain_names = [ "test.com" ]
    }
	
	vcn_id = oci_core_vcn.test_vcn.id

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	display_name = var.dhcp_options_display_name
	domain_name_type = var.dhcp_options_domain_name_type
	freeform_tags = {"Department"= "Finance"}
}

Argument Reference

The following arguments are supported:

** 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

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Dhcp Options * update - (Defaults to 20 minutes), when updating the Dhcp Options * delete - (Defaults to 20 minutes), when destroying the Dhcp Options

Import

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

$ terraform import oci_core_dhcp_options.test_dhcp_options "id"