99designs/iamy

Error fetching S3 data

grassdog opened this issue · 9 comments

Hi,

I'm using version v2.0.0-beta2 (love the list normalisation change btw) and have run into an issue when pulling down S3 data.

$ iamy pull
Error fetching S3 data: Error listing buckets: Error while calling ListBuckets: MissingRegion: could not find region configuration130 <nil>

Not sure where configuration130 is coming from. Any ideas on why it's getting an incorrect region?

I'm affected by this issue as well. There is some discussion on this issue in #13 (comment). Setting default_region in my ~/.aws/config doesn't fix it, but setting region = us-east-1 does fix it for me, and I'm happy with this workaround for now until it gets fixed.

Gotcha. Thanks for the pointer to that.

Ah yes. We should probably provide a clearer error message. The annoyance is that this tool requires the aws tool to be configured correctly, however the SDK doesn't pick up the aws cli config.

This has now been fixed in the SDK aws/aws-sdk-go#761 so the fix should be to enable that feature

I've addressed this issue in #20 @grassdog. Give it a go and see if works for you as I've only been using aws-vault and I'm sure there's other ways of configuring the AWS CLI that I'm not testing

https://github.com/99designs/iamy/releases/tag/v2.0.0-beta3

I run it via aws-vault too. If I set AWS_REGION when I run it, it completes fine.

i.e. AWS_REGION=us-east-1 aws-vault exec admin -- iamy pull

lox commented

Do you have a region defined in your ~/.aws/config for the admin profile?

See https://github.com/99designs/aws-vault/blob/d84315c29bbe45ab979a94f0bcecfcb7ecb307a8/exec.go#L97

I had it under the default profile but I guess that wasn't being cascaded down to admin. I just added it to admin and it runs a treat without the ENV variable being set. 🎉

lox commented

Yeah, it's confusing like that. Glad that fixes it for you @grassdog.

OK great, thanks @grassdog, will resolve this issue