vincbeck commented on code in PR #77419:
URL: https://github.com/apache/airflow/pull/77419#discussion_r4670288986


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/eks.py:
##########
@@ -674,7 +674,9 @@ def generate_config_file(
         session._session.set_config_variable("sts_regional_endpoints", 
"regional")
         sts_client = session.client(
             "sts",
-            endpoint_url=self.conn_config.get_service_endpoint_url("sts"),
+            # Not get_service_endpoint_url: it falls back to the 
connection-wide endpoint_url, which on an
+            # EKS connection is an EKS endpoint, and EKS rejects tokens signed 
for a non-STS host.
+            
endpoint_url=self.conn_config.get_service_config("sts").get("endpoint_url"),

Review Comment:
   nit: can you also update rule 2 of the `endpoint_url` precedence in 
`providers/amazon/docs/connections/aws.rst`? It says only the STS clients for 
assume role and test connection skip the root-level `endpoint_url`.



##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/eks.py:
##########
@@ -674,7 +674,9 @@ def generate_config_file(
         session._session.set_config_variable("sts_regional_endpoints", 
"regional")
         sts_client = session.client(
             "sts",
-            endpoint_url=self.conn_config.get_service_endpoint_url("sts"),
+            # Not get_service_endpoint_url: it falls back to the 
connection-wide endpoint_url, which on an

Review Comment:
   nit: `get_service_endpoint_url("sts", sts_connection_assume=True)` already 
skips the connection-wide `endpoint_url`. Can you use it so the STS endpoint 
rules stay in one place?



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