DhcpOptions
Source:
src/AWS/EC2/DhcpOptions.ts
A DHCP options set configures the DHCP parameters (domain name, DNS servers, NTP servers, NetBIOS settings) that a VPC hands out to the instances launched inside it. Attach a custom set to a VPC to override the AWS defaults — for example to point instances at your own DNS or an internal search domain.
A DHCP options set is immutable: AWS provides no edit API, so changing any
DHCP parameter replaces the set. Setting vpcId associates the set with a
VPC; clearing it (or deleting the resource) re-associates the VPC with the
account’s default options set, since a set must be disassociated from every
VPC before it can be deleted.
Creating a DHCP Options Set
Section titled “Creating a DHCP Options Set”Custom DNS and Search Domain
const dhcp = yield* AWS.EC2.DhcpOptions("CorpDhcp", { domainName: "corp.internal", domainNameServers: ["10.0.0.2", "AmazonProvidedDNS"], vpcId: myVpc.vpcId,});Creates the options set and associates it with the VPC in one step.
Instances launched into the VPC receive the corp.internal search domain and
the listed DNS servers.
NTP and NetBIOS Configuration
const dhcp = yield* AWS.EC2.DhcpOptions("Dhcp", { ntpServers: ["169.254.169.123"], netbiosNameServers: ["10.0.0.5"], netbiosNodeType: "2",});Creates an unassociated options set that you can associate later by setting
vpcId.