aws-samples / sample-python-helper-aws-appconfig

A Python helper library for AWS AppConfig
Apache License 2.0
31 stars 9 forks source link

ValueError: Invalid endpoint: https://appconfigdata..amazonaws.com #8

Closed gargvarun072 closed 2 years ago

gargvarun072 commented 2 years ago

Traceback (most recent call last):


File "/usr/local/lib/python3.7/site-packages/appconfig_helper/appconfig_helper.py", line 64, in init self._client = session.client("appconfigdata") File "/usr/local/lib/python3.7/site-packages/boto3/session.py", line 309, in client config=config, File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 959, in create_client api_version=api_version, File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 132, in create_client endpoint_bridge, File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 475, in _get_client_args endpoint_bridge, File "/usr/local/lib/python3.7/site-packages/botocore/args.py", line 134, in get_client_args proxies_config=new_config.proxies_config, File "/usr/local/lib/python3.7/site-packages/botocore/endpoint.py", line 402, in create_endpoint raise ValueError("Invalid endpoint: %s" % endpoint_url) ValueError: Invalid endpoint: https://appconfigdata..amazonaws.com

Python Package Version Details boto3 1.24.46 botocore 1.27.46 sample-helper-aws-appconfig 2.0.3

I have tried with multiple downgraded versions of boto3 and botocore but, this error is constant.

jamesoff commented 2 years ago

Looks like you're missing the region name in your AWS config somewhere, or it's set to the empty string.

Do you have AWS_DEFAULT_REGION exported in your environment, or region= in your AWS config file (e.g. ~/.aws/config)? If not, you'll need something like that. If you do, check the value is something like eu-west-1 (of course substitute in the region you're actually using :)

That value is used (by boto3, not this library specifically) to build the API endpoint URL, which is supposed to have the region name between "appconfigdata" and "amazonaws.com", for example appconfigdata.eu-west-1.amazonaws.com.

If you want, you can also pass a configured boto3 Session instance to AppConfigHelper() using session= keyword argument. This will override the credentials/region otherwise being used.

gargvarun072 commented 2 years ago

Thanks @jamesoff. It working as expected.