Create an AWS VPC subnet in Terraform

First, create VPC as subnet attaches to VPC id.

Next, add to your Terraform code:

resource "aws_subnet" "mtc_public_subnet" {
  vpc_id = aws_vpc.mtc_vpc.id
  cidr_block = "10.123.1.0/24"
  map_public_ip_on_launch = true
  availability_zone = "us-east-1a"
  
  tags = {
    Name = "dev-public"
  }
  }
Finally, run plan and apply