When the s3 repository is in a region that differs from the user's configured region, all downloads fail.
This is first seen when downloading the truststore.
Error Message:
2023/01/12 09:06:13 Failed to fetch remote truststore: failed to download truststore from https://aws-dbt.s3.us-east-1.amazonaws.com/truststore: BucketRegionError: incorrect region, the bucket is not in 'us-west-1' region at endpoint '', bucket is in 'us-east-1' region
status code: 301, request id: G7B9KX58Y35M55G5, host id: NqSpzVw9ZcAOoEqUNswDM2kAbQOT2TO4XbhtSkAITxKqOosBF13sHxZf79R+2+Jhi6qKxRNGhDU=.
If you want to try in 'offline' mode, retry your command again with: dbt -o ...
At present, dbt uses whatever configuration the client's computer has in place. Ideally, the s3 code should determine the region needed for the repository's s3 bucket and make all calls with that region.
When the s3 repository is in a region that differs from the user's configured region, all downloads fail.
This is first seen when downloading the truststore.
Error Message:
2023/01/12 09:06:13 Failed to fetch remote truststore: failed to download truststore from https://aws-dbt.s3.us-east-1.amazonaws.com/truststore: BucketRegionError: incorrect region, the bucket is not in 'us-west-1' region at endpoint '', bucket is in 'us-east-1' region status code: 301, request id: G7B9KX58Y35M55G5, host id: NqSpzVw9ZcAOoEqUNswDM2kAbQOT2TO4XbhtSkAITxKqOosBF13sHxZf79R+2+Jhi6qKxRNGhDU=.
If you want to try in 'offline' mode, retry your command again with: dbt -o ...
At present, dbt uses whatever configuration the client's computer has in place. Ideally, the s3 code should determine the region needed for the repository's s3 bucket and make all calls with that region.
Region config is already being parsed here: https://github.com/nikogura/dbt/blob/master/pkg/dbt/dbt.go#L99
Need to store this info, and use it in all s3 calls.