@@ -97,6 +97,11 @@ def __init__(
9797 self .map_public_ip_on_launch = map_public_ip_on_launch
9898 self .assign_ipv6_address_on_creation = ipv6_native
9999 self .ipv6_cidr_block_associations : dict [str , dict [str , Any ]] = {}
100+ self .private_dns_name_options_on_launch = {
101+ "HostnameType" : "ip-name" ,
102+ "EnableResourceNameDnsARecord" : False ,
103+ "EnableResourceNameDnsAAAARecord" : False ,
104+ }
100105 if ipv6_cidr_block :
101106 self .attach_ipv6_cidr_block_associations (ipv6_cidr_block )
102107
@@ -631,11 +636,15 @@ def delete_subnet(self, subnet_id: str) -> Subnet:
631636 raise InvalidSubnetIdError (subnet_id )
632637
633638 def modify_subnet_attribute (
634- self , subnet_id : str , attr_name : str , attr_value : str
639+ self , subnet_id : str , attr_name : str , attr_value : bool
635640 ) -> None :
636641 subnet = self .get_subnet (subnet_id )
637642 if attr_name in ("map_public_ip_on_launch" , "assign_ipv6_address_on_creation" ):
638643 setattr (subnet , attr_name , attr_value )
644+ elif attr_name == "enable_resource_name_dns_a_record_on_launch" :
645+ subnet .private_dns_name_options_on_launch [
646+ "EnableResourceNameDnsARecord"
647+ ] = attr_value
639648 else :
640649 raise InvalidParameterValueError (attr_name )
641650
0 commit comments