Variable in terraform

Is it possible to use a variable in this way?

subnets = [data.terraform_remote_state.vpc.outputs.${Subnet_Public_A}, data.terraform_remote_state.vpc.outputs.${Subnet_Public_B}]

I am using for_each, and I want to have different subnets for different each.value.subnet

thank you,