sts_client = boto3.client('sts', endpoint_url="https://sts.eu-west-1.amazonaws.com)sts_response = sts_client.assume_role(RoleArn='arn:aws:iam:0123456789:role/example-role, RoleSessionName='test'my_session = boto3.Session(region_name='eu-west-1',aws_access_key_id=sts_response.get('Credentials',{}).get('AccessKeyId'),aws_secret_access_key_id=sts_response.get('Credentials',{}).get('SecretAccessKey'),aws_session_token=sts_response.get('Credentials',{}).get('SessionToken'))awswraggler.athena.read_sql_query("select * from database.table limit 10", database="database", ctas_approach=False, boto3_session=my_session)The request times out with an error saying it can not connect to _https://sts.amazonaws.com_. This is expected as the global STS endpoint will not resolve due to no internet access and VPC endpoint should be used.
Able to run the query against Amazon Athena using VPC endpoint without error.
No
No internet access, STS and Amazon Athena VPC endpoints are up and working. Tested connectivity using VPC endpoints using native boto3 commands
Looking in to botocore and boto3 sessions, they do not have a configuration item to force the package to use regional endpoints, this can only be set on the client.
Have the ability to set the endpoint_url the appropriate clients manually as a first step. A next step could be the ability to tell the package to use regional endpoint_urls which will default to standard AWS VPC endpoints for the service.
Thanks @martinSpears-ECS, we will add VPC endpoints support in our next minor release (1.10.0).
Hi @martinSpears-ECS
I've just added the related endpoints to our global configs, so you can configure it programmatically:
wr.config.sts_endpoint_url = YOUR_ENDPOINT
OR you can define it through the environment variables:
export WR_STS_ENDPOINT_URL=YOUR_ENDPOINT
All endpoints available are:

Do you mind to install it directly from our repository and check if it is everything fine for your use case before the official release?
The idea is to publish it in the version 1.10.0 this weekend.
pip install git+https://github.com/awslabs/aws-data-wrangler.git --no-use-pep517
P.S. For more details check the commit above and/or our Global Config tutorial.
Released on 1.10.0
Most helpful comment
Thanks @martinSpears-ECS, we will add VPC endpoints support in our next minor release (
1.10.0).