TGViewer
AWS Notes AWS Notes @aws_notes · 5.82K subscribers
Post #3167 2.09K
OpenTofu 1.9: for_each in the provider block

https://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
opentofu.org What's new in OpenTofu 1.12? | OpenTofu Learn about the changes in OpenTofu 1.12.
  • ❤ 22
More from @aws_notes
  1. Oct 1, 2026Приглашаем на встречу Gnomish Factory. Часть 2: настраиваем свой проект под использование…
  2. Sep 30, 2026🔥 Вышел релиз 0.36.1 SRE Learning Platform - курс по KCSA( Kubernetes and Cloud Native Se…
  3. Sep 28, 2026Issue #247 | 28 Sep 2026 ▪️ Bedrock Claude Opus 5.5 ▪️ Bedrock OpenAI GPT-6 Sol and GPT-6…
  4. Sep 25, 2026Post #3689
  5. Sep 23, 2026Приглашаем на встречу Gnomish Factory: зачем я написал ещё одну Dark Factory Про тёмные фа…
  6. Sep 21, 2026🆕 Beanstalk + EKS Auto Mode = Beanstalk Cluster Mode 🎉 https://aws.amazon.com/blogs/aws/…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →