# CfnDHCPOptionsProps

Struct · External

Properties for defining a `CfnDHCPOptions`.

Used as props by: [CfnDHCPOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnDHCPOptions.html)

- Source: Generated at build time
- Type last changed: v2.134.0 · 26 Mar 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnDHCPOptionsProps: ec2.CfnDHCPOptionsProps = {
  domainName: 'domainName',
  domainNameServers: ['domainNameServers'],
  ipv6AddressPreferredLeaseTime: 123,
  netbiosNameServers: ['netbiosNameServers'],
  netbiosNodeType: 123,
  ntpServers: ['ntpServers'],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

cfn_dhcp_options_props = ec2.CfnDHCPOptionsProps(
    domain_name="domainName",
    domain_name_servers=["domainNameServers"],
    ipv6_address_preferred_lease_time=123,
    netbios_name_servers=["netbiosNameServers"],
    netbios_node_type=123,
    ntp_servers=["ntpServers"],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

CfnDHCPOptionsProps cfnDHCPOptionsProps = CfnDHCPOptionsProps.builder()
        .domainName("domainName")
        .domainNameServers(List.of("domainNameServers"))
        .ipv6AddressPreferredLeaseTime(123)
        .netbiosNameServers(List.of("netbiosNameServers"))
        .netbiosNodeType(123)
        .ntpServers(List.of("ntpServers"))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var cfnDHCPOptionsProps = new CfnDHCPOptionsProps {
    DomainName = "domainName",
    DomainNameServers = new [] { "domainNameServers" },
    Ipv6AddressPreferredLeaseTime = 123,
    NetbiosNameServers = new [] { "netbiosNameServers" },
    NetbiosNodeType = 123,
    NtpServers = new [] { "ntpServers" },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDHCPOptionsProps := &CfnDHCPOptionsProps{
	DomainName: jsii.String("domainName"),
	DomainNameServers: []*string{
		jsii.String("domainNameServers"),
	},
	Ipv6AddressPreferredLeaseTime: jsii.Number(123),
	NetbiosNameServers: []*string{
		jsii.String("netbiosNameServers"),
	},
	NetbiosNodeType: jsii.Number(123),
	NtpServers: []*string{
		jsii.String("ntpServers"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `domainName`: 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* ).

- `domainNameServers`: 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.

- `ipv6AddressPreferredLeaseTime`: 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.

- `netbiosNameServers`: string[] — The IPv4 addresses of up to four NetBIOS name servers.

- `netbiosNodeType`: number — The NetBIOS node type (1, 2, 4, or 8).

  We recommend that you specify 2 (broadcast and multicast are not currently supported).

- `ntpServers`: string[] — The IPv4 addresses of up to four Network Time Protocol (NTP) servers.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — Any tags assigned to the DHCP options set.
