AWS::EC2::DHCPOptions - AWS CloudFormation

AWS::EC2::DHCPOptions

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.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::EC2::DHCPOptions", "Properties" : { "DomainName" : String, "DomainNameServers" : [ String, ... ], "Ipv6AddressPreferredLeaseTime" : Integer, "NetbiosNameServers" : [ String, ... ], "NetbiosNodeType" : Integer, "NtpServers" : [ String, ... ], "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::EC2::DHCPOptions Properties: DomainName: String DomainNameServers: - String Ipv6AddressPreferredLeaseTime: Integer NetbiosNameServers: - String NetbiosNodeType: Integer NtpServers: - String Tags: - Tag

Properties

DomainName

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).

Required: No

Type: String

Update requires: Replacement

DomainNameServers

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.

Required: Conditional

Type: Array of String

Update requires: Replacement

Ipv6AddressPreferredLeaseTime

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.

Required: No

Type: Integer

Update requires: Replacement

NetbiosNameServers

The IPv4 addresses of up to four NetBIOS name servers.

Required: Conditional

Type: Array of String

Update requires: Replacement

NetbiosNodeType

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

Required: No

Type: Integer

Update requires: Replacement

NtpServers

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

Required: Conditional

Type: Array of String

Update requires: Replacement

Tags

Any tags assigned to the DHCP options set.

Required: No

Type: Array of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource ID.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

DhcpOptionsId

The ID of the DHCP options set.

Examples

Create a DHCP options set

The following example creates a DHCP options set.

YAML

myDhcpOptions: Type: AWS::EC2::DHCPOptions Properties: DomainName: example.com DomainNameServers: - AmazonProvidedDNS NtpServers: - 10.2.5.1 NetbiosNameServers: - 10.2.5.1 NetbiosNodeType: 2 Tags: - Key: project Value: 123

JSON

{ "myDhcpOptions" : { "Type" : "AWS::EC2::DHCPOptions", "Properties" : { "DomainName" : "example.com", "DomainNameServers" : [ "AmazonProvidedDNS" ], "NtpServers" : [ "10.2.5.1" ], "NetbiosNameServers" : [ "10.2.5.1" ], "NetbiosNodeType" : 2, "Tags" : [ { "Key" : "project", "Value" : "123" } ] } } }

See also