What will happen in this scenario?
The VPC will modify the first subnet CIDR automatically to allow the second subnet IP range
The second subnet will be created
It will throw a CIDR overlaps error
It is not possible to create a subnet with the same CIDR as VPC
Explanations:
A VPC cannot automatically modify the CIDR of a subnet. Subnet CIDRs must be defined explicitly and cannot overlap with existing subnets.
The second subnet cannot be created because its CIDR range (20.0.0.1/24) overlaps with the CIDR of the existing subnet (20.0.0.0/16).
The attempt to create the second subnet will result in a CIDR overlaps error since the specified CIDR range conflicts with the existing subnet’s CIDR.
While it is true that a subnet cannot have the same CIDR as the VPC, the main issue here is the overlapping CIDR range of the existing subnet, not the VPC’s CIDR itself.