Add subnet into existing default VPC with Terraform
Define data source to retrieve an existing default AWS VPC:
data "aws_vpc" "existing_vpc" {
default = true
}
Declare an AWS subnet resource named dev-subnet.
This subnet is associated with the retrieved existing VPC and configured with a specific CIDR block 172.31.48.0/20: