AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::DHCPOptions

CfnDHCPOptions

Specifies a set of DHCP options for your VPC. You must specify at least one of the following properties: `DomainNameServers` , `NetbiosNameServers` , `NtpServers` . If you specify `NetbiosNameServers` , you must specify `NetbiosNodeType` .

Import

import { CfnDHCPOptions } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnDHCPOptions

Properties

Configuration passed to the constructor as CfnDHCPOptionsProps.

domainNameOptional
string

This value is used to complete unqualified DNS hostnames. If you're using AmazonProvidedDNS in `us-east-1` , specify `ec2.internal` . If you're using AmazonProvidedDNS in another Region, specify *region* . `compute.internal` (for example, `ap-northeast-1.compute.internal` ). Otherwise, specify a domain name (for example, *MyCompany.com* ).

domainNameServersOptional
string[]

The IPv4 addresses of up to four domain name servers, or `AmazonProvidedDNS` . The default is `AmazonProvidedDNS` . To have your instance receive a custom DNS hostname as specified in `DomainName` , you must set this property to a custom DNS server.

ipv6AddressPreferredLeaseTimeOptional
number

A value (in seconds, minutes, hours, or years) for how frequently a running instance with an IPv6 assigned to it goes through DHCPv6 lease renewal. Acceptable values are between 140 and 2147483647 seconds (approximately 68 years). If no value is entered, the default lease time is 140 seconds. If you use long-term addressing for EC2 instances, you can increase the lease time and avoid frequent lease renewal requests. Lease renewal typically occurs when half of the lease time has elapsed.

netbiosNameServersOptional
string[]

The IPv4 addresses of up to four NetBIOS name servers.

netbiosNodeTypeOptional
number

The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported).

ntpServersOptional
string[]

The IPv4 addresses of up to four Network Time Protocol (NTP) servers.

tagsOptional
CfnTag[]

Any tags assigned to the DHCP options set.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic