Reference resource created with a module using for_each

Hi everybody !

Im new to terraform and especially the modules and loops, i was able to create multiple resources with for_each loop in a module, my problem is that i cant find out which resource Terraform created for a specific item of my map which i looped on.
Here is my code :

vpc module :
resource “aws_vpc” “vpc_test” {
for_each = var.vpcs
cidr_block = each.value.cidr

resource “aws_subnet” “subnet0” {
for_each = var.subnet_cidr_per_az

vpc_id = var.subnet_vpc_id
cidr_block = each.value.cidr
availability_zone =
availability_zone_id = each.value.az_id
ipv6_cidr_block = each.value.subnet_ipv6_cidr_block
map_public_ip_on_launch = each.value.subnet_map_public_ip_on_launch
outpost_arn = each.value.subnet_outpost_arn
assign_ipv6_address_on_creation =
tags = merge(var.tags, { Name = “${each.key}”})

.tfvars file :
#------------------------vpc vars----------------------------------
vpcs = {“ANewVPC”={cidr=“”},“AnotherNewVPC”={cidr=“”}}
#------------------------subnet vars-------------------------------
subnet_cidr_per_az = {
“subnet_name1” = {vpc_name =“ANewVPC”,cidr = “”, az = “us-east-1a”,az_id=“”,ipv6_cidr_block=“”,subnet_map_public_ip_on_launch=false,subnet_outpost_arn=“”,subnet_assign_ipv6_address_on_creation=false,tags={}}
“subnet_name2” = {vpc_name =“ANewVPC”,cidr = “”, az = “us-east-1b”,az_id=“”,ipv6_cidr_block=“”,subnet_map_public_ip_on_launch=false,subnet_outpost_arn=“”,subnet_assign_ipv6_address_on_creation=false,tags={}}
“subnet_name3” = {vpc_name =“ANewVPC”,cidr = “”, az = “us-east-1c”,az_id=“”,ipv6_cidr_block=“”,subnet_map_public_ip_on_launch=false,subnet_outpost_arn=“”,subnet_assign_ipv6_address_on_creation=false,tags={}}

My code is not finished for the moment.

I added the value vpc_name in my subnet map to identify the VPC that it will created on wich is the same as the key in the VPC map, my problem is that when i create many VPCs with the VPC module i cant tell which one Terraform created for every entry in my map.

I can output the ids of the VPCs but i have no way to tell what is the ID of the VPC that was created from a certain map entry , is there a way to identify the resources created with for_each by the map key ?