Creating Multiple SNS topics with their respective subscription with one module

I have a code that only creates one sns topic with its subscription but I want a code that creates list of sns topics, each topic maps to a particular list of subscriptions.
These used to be my codes:

**child module**
module "sns_topic" {
  source  = "terraform-aws-modules/sns/aws"

  name  = var.sns_topic_name

  subscriptions = var.subscriptions

  tags = var.tags
}

**Root module**
module "contract_sns" {
  source = "path/to/my/module"

  sns_topic_name = var.sns_topic_1
  subscriptions = merge(
    {
      for fn in var.lambda_for_sns :
      "lambda-${fn}" => {
        endpoint = module.lambda_for_sns[fn].lambda_arn
        protocol = "lambda"
      }
    },
    {
      for url in var.https_endpoint :
      "https-${url}" => {
        endpoint = url
        protocol = "https"
      }
    }
  )

  tags  = var.tags
}

But I need a module that allows me to create list of sns topics and each topics are mapped to its subscription.