Skip to content

Resource: awsVpcDhcpOptions

Provides a VPC DHCP Options resource.

Example Usage

Basic usage:

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.vpcDhcpOptions.VpcDhcpOptions(this, "dns_resolver", {
  domainNameServers: ["8.8.8.8", "8.8.4.4"],
});

Full usage:

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.vpcDhcpOptions.VpcDhcpOptions(this, "foo", {
  domainName: "service.consul",
  domainNameServers: ["127.0.0.1", "10.0.0.2"],
  netbiosNameServers: ["127.0.0.1"],
  netbiosNodeType: 2,
  ntpServers: ["127.0.0.1"],
  tags: {
    Name: "foo-name",
  },
});

Argument Reference

The following arguments are supported:

  • domainName - (Optional) the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the search value in the /etc/resolvConf file.
  • domainNameServers - (Optional) List of name servers to configure in /etc/resolvConf. If you want to use the default AWS nameservers you should set this to amazonProvidedDns.
  • ntpServers - (Optional) List of NTP servers to configure.
  • netbiosNameServers - (Optional) List of NETBIOS name servers.
  • netbiosNodeType - (Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Remarks

  • Notice that all arguments are optional but you have to specify at least one argument.
  • domainNameServers, netbiosNameServers, ntpServers are limited by AWS to maximum four servers only.
  • To actually use the DHCP Options Set you need to associate it to a VPC using awsVpcDhcpOptionsAssociation.
  • If you delete a DHCP Options Set, all VPCs using it will be associated to AWS's default DHCP Option Set.
  • In most cases unless you're configuring your own DNS you'll want to set domainNameServers to amazonProvidedDns.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the DHCP Options Set.
  • arn - The ARN of the DHCP Options Set.
  • ownerId - The ID of the AWS account that owns the DHCP options set.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

You can find more technical documentation about DHCP Options Set in the official AWS User Guide.

Import

VPC DHCP Options can be imported using the dhcpOptionsId, e.g.,

$ terraform import aws_vpc_dhcp_options.my_options dopt-d9070ebb