Taragolis commented on issue #27078:
URL: https://github.com/apache/airflow/issues/27078#issuecomment-1344633330
Oh... right. Forget that STS didn't use regional endpoint by default in
`boto3`. And it should be enabled by set environment variable
`AWS_STS_REGIONAL_ENDPOINTS` to `regional` all other clients use regional
endpoints by default (except some S3 regions)
```python
import os
import boto3
os.environ["AWS_DEFAULT_REGION"] = "eu-west-1"
session = boto3.session.Session()
emr_client = session.client("emr")
print(f"Client info: {emr_client.meta.config.user_agent}")
print(f"STS Endpoint URL: {emr_client.meta.endpoint_url}")
sts_client = session.client("sts")
print(f"STS Endpoint URL: {sts_client.meta.endpoint_url}")
os.environ["AWS_STS_REGIONAL_ENDPOINTS"] = "regional"
sts_client_regional = session.client("sts")
print(f"STS Endpoint URL: {sts_client_regional.meta.endpoint_url}")
```
I have an idea to enable set endpoint url by dictionary (on service level)
in connection rather than define it for all services.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]