Search code examples
amazon-web-servicesamazon-s3terraformterraform-provider-awsaws-regions

Dynamically create AWS S3 buckets in multiple regions


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?


Solution

  • 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)