Skip to content

boto3 iotanalytics client has endpoint value error

0

using sagemaker jupytor notebook instance code as below import boto3

client = boto3.client('iotanalytics')

anomaly_client = boto3.client('iot-data', region_name='us-east-1', endpoint_url = 'a2nnb1d4l4rnib-ats.iot.us-east-1.amazonaws.com ') when run following error ValueError: Invalid endpoint: a2nnb1d4l4rnib-ats.iot.us-east-1.amazonaws.com while this endpoint is working fine with python file to publish data on IoT Core

2 Answers
1

In boto3, when specifying endpoint_url, this url will be validated against a few rules. Code: https://github.com/boto/botocore/blob/9e9d4831d2f28a2a338406a8b16608976e034761/botocore/utils.py#L1230

Basically, the endpoint url need to follow

<scheme>://<netloc>/<path>?<query>#<fragment>

You are missing the scheme, i.e. http:// or https://

I tested locally in my computer, adding those schemes will see client created successfully.

AWS
answered 3 years ago
AWS
EXPERT
reviewed 3 years ago
0

Yes! It worked Many thanks

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.