digvijay-y commented on code in PR #55254:
URL: https://github.com/apache/airflow/pull/55254#discussion_r2322513350


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -730,11 +730,16 @@ def get_client_type(
         session = self.get_session(region_name=region_name, 
deferrable=deferrable)
         endpoint_url = 
self.conn_config.get_service_endpoint_url(service_name=service_name)
         if not isinstance(session, boto3.session.Session):
+            # Fetch credentials from Airflow connection
+            credentials = self._get_async_credentials()
+            account_id_endpoint_mode = "standard"
             return session.create_client(
                 service_name=service_name,
                 endpoint_url=endpoint_url,
                 config=self._get_config(config),
                 verify=self.verify,
+                credentials=credentials,
+                account_id_endpoint_mode=account_id_endpoint_mode,

Review Comment:
   Fetching credentials with self._get_async_credentials() we could ensure that 
when operators—like GlueJobOperator in deferrable mode—run asynchronously, they 
still have the correct AWS credentials. with account_id_endpoint_mode we could 
improve AWS endpoints for multi-accounts setups.



-- 
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]

Reply via email to