79604021

Date: 2025-05-02 19:40:05
Score: 1
Natty:
Report link

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

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: aids