ieunea1128 commented on code in PR #32664:
URL: https://github.com/apache/airflow/pull/32664#discussion_r1269677374
##########
airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -796,7 +796,11 @@ def test_connection(self):
"""
try:
session = self.get_session()
- conn_info = session.client("sts").get_caller_identity()
+ test_endpoint_url =
self.conn_config.extra_config.get("test_endpoint_url")
+ conn_info = session.client(
+ "sts",
+ endpoint_url=test_endpoint_url,
Review Comment:
Both of them returned successful result when I've tested both being None and
a parameter not provided to the function.
I've executed code below
```python
conn = Connection(
conn_id="sample_aws_connection",
conn_type="aws",
login="access_key", # Reference to AWS Access Key ID
password="secret_key", # Reference to AWS Secret Access Key
extra={
"test_endpoint_url": "https://sts.us-east-1.amazonaws.com",
"region_name": "us-east-1"
},
)
env_key = f"AIRFLOW_CONN_{conn.conn_id.upper()}"
conn_uri = conn.get_uri()
os.environ[env_key] = conn_uri
conn.test_connection()
```
and I've compared results of two connection. Both of them returned
successful result, and there's difference of ```RequestID``` in
```ResponseMetadata``` and ```x-amzn-requestid```, ```date``` in
```HTTPHeaders```
```python
conn_info = session.client(
"sts",
endpoint_url=test_endpoint_url,
).get_caller_identity()
conn_info_without_endpoint_url = session.client(
"sts"
).get_caller_identity()
```
Is there anything more needed to be checked?
--
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]