Closed jnioche closed 4 months ago
Hi @jnioche, thank you for reporting this issue.
I fully agree, error handling deserve better error messages. For info, we have a similar issue when credentials are incorrects #164
@jnioche please just let me know if you intend to propose a PR for this, (otherwise I will put it on my todo list).
@jnioche please just let me know if you intend to propose a PR for this, (otherwise I will put it on my todo list).
my RUST skills are very limited, I'm afraid.
@jnioche please just let me know if you intend to propose a PR for this, (otherwise I will put it on my todo list).
my RUST skills are very limited, I'm afraid.
No worries with Rust ;-)
I much appreciate you reported the issue in the first place.
Until we have a proper fix, I will mention it in the documentation #442 .
Had a quick look, there is no way of validating a region in the AWS SDK. There is a JSON file in this repo listing all the regions; it would need to be imported as a resource.
Actually, since I had specified an AWS profile with
export AWS_PROFILE
and that the config for that profile has
region = us-east-1
shouldn't the region specified there override the default value?
Setting
export AWS_DEFAULT_REGION=us-east-1
does not have an impact either
Thanks to your feedback, I simplified the code related to how cloud-scanners picks up the region.
See this PR #447.
Now, the logic is:
AWS_DEFAULT_REGION
environment variable).Furthermore I added a check (and hoppefully a more explicit error message) after this step so that we should be warned if the region is not supported by cloud scanner (like if AWS opens a new region or if in case of a typo in the region name).
Thanks @demeringo, just tested your change, it works fine
Problem
The problem is simply that
eu-east-1
is a typo.us-east-1
was the correct value. The error message could be more explicit and tell the user that there is no such region.Solution
An internal lookup of the allowed values and a message indicating that the value does not exist.