0

Is there a way to create terraform aws_s3_bucket resources dynamically in different regions? Argument region is no longer supported, creating provider aliases in different regions dynamically is also not supported. Is there a way to do this?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136

1 Answers1

1

Yes - you can use Provider Aliasing and regions are reported as supported per the AWS provider documentation

I suggest keeping your terraform cleanly modularized when using aliasing to keep the copy/paste code per region to a minimum

Check out this other answer already addressing this for an implementation example (the latest answer 2021)

Bobshark
  • 376
  • 1
  • 3
  • 12
  • I was hoping for something more concise, something like `for_each` for providers, but yes, I guess modules with provider parameters is the best compromise at this time. Thanks! – Yuriy Galanter Feb 11 '22 at 03:05