cloudsploit icon indicating copy to clipboard operation
cloudsploit copied to clipboard

Missing region in config Error Message in AWS prevents running the collection/scan

Open devkdd opened this issue 2 years ago • 4 comments

Hi,

Thanks for creating this cloud assessment tool. I am actively using it.

When running the latest code for AWS, I am getting below error hence it does not complete the scan.

*** [INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError", ...} ***

After that it goes to a retry loop -

Earlier code that I have (as of Sep 30th, 2021) do run properly for the same AWS account.

Is there anything I need to do in AWS to resolve it (i.e. configure regions, enable/disable, etc.) ? Or is this potentially a bug ?

When I am running this for a client, I cannot simply ask them to enable all regions just to run the scan (assuming that is the issue).

I did try specifying regions I want (as parameters/aws config) but still get the same results.

(I see that collectior.js and regions.js have been updated somewhat and they have more checks and explicit product-region mappings in the latest code).

Thanks for looking into it.


INFO: Found 273 API calls to make for aws plugins INFO: Collecting metadata. This may take several minutes... [INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError", ...} Trying again in: 2.808 seconds Trying again in: 4.662 seconds Trying again in: 5.25 seconds


devkdd avatar Jan 18 '22 22:01 devkdd

try exporting the region env variable like export AWS_REGION='us-west-2' this will get rid of the error message.

The trying again in seems like is caused by something different. I believe AWS may be rate limiting the api calls more aggressively these days. If you let it run, it should eventually complete as normal, but will definitely take a lot longer. It would be good for someone with more insite to take a look at this.

D00gs avatar Jan 21 '22 06:01 D00gs

the export AWS_REGION='us-west-2' env variable fixed it for me, but i already have region set in my AWS Credentials file, why doesn't it pick that up?

adrwh avatar Nov 22 '22 18:11 adrwh

In my case AWS.config.update({region: "us-east-1"}); fixed it for me. and you can also fix it that way in the shell export AWS_SDK_LOAD_CONFIG=1. Solution for windows users set AWS_SDK_LOAD_CONFIG=1

joss12 avatar Oct 16 '23 01:10 joss12

@joss12 Where in the code did you update it? AWS.config.update({region: "us-east-1"});

oleglevenkovtel avatar Nov 14 '23 20:11 oleglevenkovtel