Skip to content

fix: add https to regional STS endpoint #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sagemaker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def sts_regional_endpoint(region):
Returns:
str: AWS STS regional endpoint
"""
return "sts.{}.amazonaws.com".format(region)
return "https://sts.{}.amazonaws.com".format(region)


class DeferredError(object):
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import time

from boto3 import exceptions
import botocore
import pytest
from mock import call, patch, Mock, MagicMock

Expand Down Expand Up @@ -564,4 +565,5 @@ def walk():

def test_sts_regional_endpoint():
endpoint = sagemaker.utils.sts_regional_endpoint("us-west-2")
assert endpoint == "sts.us-west-2.amazonaws.com"
assert endpoint == "https://sts.us-west-2.amazonaws.com"
assert botocore.utils.is_valid_endpoint_url(endpoint)