Hi@akhtar,
we can also enable the Public DNS Hostnames by calling the client method of boto3 library and then accessing the modify_vpc_attribute() method, so that we can access the public DNS names of the EC2 instance we would be creating in this VPC.
ec2Client = boto3.client('ec2')
ec2Client.modify_vpc_attribute( VpcId = vpc.id , EnableDnsSupport = { 'Value': True } )
ec2Client.modify_vpc_attribute( VpcId = vpc.id , EnableDnsHostnames = { 'Value': True } )