Skip to content
v2.278.0

PrivateDnsNameOptionsOnLaunchProperty Struct ​

Specifies the options for instance hostnames.

Example ​

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 privateDnsNameOptionsOnLaunchProperty: ec2.CfnSubnet.PrivateDnsNameOptionsOnLaunchProperty = {
  enableResourceNameDnsAaaaRecord: false,
  enableResourceNameDnsARecord: false,
  hostnameType: 'hostnameType',
};
python
# 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

private_dns_name_options_on_launch_property = ec2.CfnSubnet.PrivateDnsNameOptionsOnLaunchProperty(
    enable_resource_name_dns_aaaa_record=False,
    enable_resource_name_dns_a_record=False,
    hostname_type="hostnameType"
)
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.*;

PrivateDnsNameOptionsOnLaunchProperty privateDnsNameOptionsOnLaunchProperty = PrivateDnsNameOptionsOnLaunchProperty.builder()
        .enableResourceNameDnsAaaaRecord(false)
        .enableResourceNameDnsARecord(false)
        .hostnameType("hostnameType")
        .build();
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 privateDnsNameOptionsOnLaunchProperty = new PrivateDnsNameOptionsOnLaunchProperty {
    EnableResourceNameDnsAaaaRecord = false,
    EnableResourceNameDnsARecord = false,
    HostnameType = "hostnameType"
};
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"

privateDnsNameOptionsOnLaunchProperty := &PrivateDnsNameOptionsOnLaunchProperty{
	EnableResourceNameDnsAaaaRecord: jsii.Boolean(false),
	EnableResourceNameDnsARecord: jsii.Boolean(false),
	HostnameType: jsii.String("hostnameType"),
}

Properties ​

enableResourceNameDnsAaaaRecordoptionalboolean | IResolvableenable_resource_name_dns_aaaa_recordoptionaltyping.Union[bool, IResolvable]enableResourceNameDnsAaaaRecordoptionalBooleanEnableResourceNameDnsAaaaRecordoptionalboolEnableResourceNameDnsAaaaRecordoptionalinterface{} #
Indicates whether to respond to DNS queries for instance hostname with DNS AAAA records.
enableResourceNameDnsARecordoptionalboolean | IResolvableenable_resource_name_dns_a_recordoptionaltyping.Union[bool, IResolvable]enableResourceNameDnsARecordoptionalBooleanEnableResourceNameDnsARecordoptionalboolEnableResourceNameDnsARecordoptionalinterface{} #
Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
hostnameTypeoptionalstringhostname_typeoptionalstrhostnameTypeoptionalStringHostnameTypeoptionalstringHostnameTypeoptional*string #
The type of hostname for EC2 instances.
notes

For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID.