Skip to content

Commit 7839d89

Browse files
Add support for STS regional endpoints
1 parent bb3fdb4 commit 7839d89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sagemaker_ssh_helper/wrapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ def _augment(self):
6969

7070
def _augment_env(self, env):
7171
if self.local_user_id is None:
72-
caller_id = boto3.client('sts').get_caller_identity()
72+
region = self.sagemaker_session.boto_region_name
73+
endpoint_url = "https://sts.{}.amazonaws.com".format(region)
74+
caller_id = boto3.client("sts", region_name=region, endpoint_url=endpoint_url).get_caller_identity()
7375
user_id = caller_id.get('UserId')
7476
else:
7577
user_id = self.local_user_id

0 commit comments

Comments
 (0)