Opentofu wants another provider before the dynamic provider. So changing the code to
provider "aws" {
alias = "by_region"
region = each.value
for_each = toset(var.region_list)
}
provider "aws" {
region = "us-east-1"
}
variable "region_list" {
type = list(string)
default = ["us-east-1", "us-east-2", "us-west-1", "us-west-2"]
}
will fix the error