for_each in the provider blockhttps://opentofu.org/docs/intro/whats-new/#provider-iteration-for_each
variable "regions" {
description = "A list of regions."
type = set(string)
}
provider "aws" {
alias = "by_region"
region = each.value
for_each = var.regions
}
module "deploy" {
source = "./deploy"
providers = {
aws = aws.by_region[each.key]
}
}#OpenTofu