Facing difficulties to create multiple AWS rest api gateway

How to create multiple AWS rest api gateway? For single api gateway it is working fine but in the case of multiple aws api gateway there more challenges like selected methods to pass and along with path_part of api should not be similar, so I tried with for_each but it is not working for me.

Below is the my code-

resource “aws_api_gateway_rest_api” “isnp-backend” {
for_each = var.api_names
name = each.value
endpoint_configuration {
types = [“REGIONAL”]
}
disable_execute_api_endpoint = true
binary_media_types = [“multipart / form-data”]
description = each.value
}

resource “aws_api_gateway_resource” “example” {
for_each = var.path_part
path_part = each.value.name

parent_id =
rest_api_id =

}
##########################################

Below are variables list

variable “api_names” {
type =set(string )
default = [ “isnp-360-uat”,“cpg-uat” ]
}

variable “path_part” {
type =set(string )
default = [ “{isnp-api+}”,“{cpg-api+}” ]
}

I think your for_each syntax is incorrect.