ustayready / fireprox

AWS API Gateway management tool for creating on the fly HTTP pass-through proxies for unique IP rotation
GNU General Public License v3.0
1.93k stars 270 forks source link

Unable to Load Credentials Error #28

Closed joswr1ght closed 2 years ago

joswr1ght commented 2 years ago

Using a --profile_name parameter returns the error Unable to load AWS credentials:

fireprox (master) $ ./fire.py --profile_name jmerckle --region us-east-1 --command list
usage: fire.py [-h] [--profile_name PROFILE_NAME] [--access_key ACCESS_KEY] [--secret_access_key SECRET_ACCESS_KEY] [--session_token SESSION_TOKEN]
               [--region REGION] [--command COMMAND] [--api_id API_ID] [--url URL]

FireProx API Gateway Manager

optional arguments:
  -h, --help            show this help message and exit
  --profile_name PROFILE_NAME
                        AWS Profile Name to store/retrieve credentials
  --access_key ACCESS_KEY
                        AWS Access Key
  --secret_access_key SECRET_ACCESS_KEY
                        AWS Secret Access Key
  --session_token SESSION_TOKEN
                        AWS Session Token
  --region REGION       AWS Region
  --command COMMAND     Commands: list, create, delete, update
  --api_id API_ID       API ID
  --url URL             URL end-point

Unable to load AWS credentials

Debugging this indicates this is the problem:

self.client = boto3.session.Session(profile_name=self.profile_name).client('apigateway')

The region is required otherwise Boto3 will raise botocore.exceptions.NoRegionError. This is a broad try/except block with no specific exception handling, so it's easy to miss this. This could be a change in Boto3 (I'm using 1.17.59) since the initial release too.

mbb5546 commented 2 years ago

I'm having this same issue but I am not providing a profile name. My AWS instance is operating under the free tier so I dont think it's a payment issue. Im not sure why but fireprox will not just load my AWS keys. Any help appreciated