shlogg · Early preview
Ian Knighton @probablynotian

Importing S3 Buckets With Aliased Providers In Terraform

Importing S3 buckets from AWS with Terraform? Use provider aliases to specify regions & avoid default config limitations. Example: `provider "aws" { alias = "east-1" region = "us-east-1" }

(if you want to skip the BS,here's an example in my GitHub)
I recently came into a situation where I needed to import multiple S3 buckets from AWS. For the most part, importing the resources is pretty straightforward. Especially when compared to other service providers.
However, in this case the resources were all over the place as far as regions. This means that you couldn't necessarily use a default configuration to import and manage the resources. This is a weird limitation in the provider where it seems that the import can only search the region of the default provider unless told otherwis...