File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 94
94
preprocess_request ,
95
95
serve_custom_service_request_handlers ,
96
96
)
97
- from localstack .constants import LOCALHOST_HOSTNAME
98
97
from localstack .services .edge import ROUTER
99
98
from localstack .services .moto import call_moto
100
99
from localstack .services .plugins import ServiceLifecycleHook
130
129
from localstack .utils .collections import get_safe
131
130
from localstack .utils .patch import patch
132
131
from localstack .utils .strings import short_uid
132
+ from localstack .utils .urls import localstack_host
133
133
134
134
LOG = logging .getLogger (__name__ )
135
135
@@ -166,8 +166,11 @@ def __init__(self, message=None):
166
166
167
167
def get_full_default_bucket_location (bucket_name ):
168
168
if config .HOSTNAME_EXTERNAL != config .LOCALHOST :
169
- return f"{ config .get_protocol ()} ://{ config .HOSTNAME_EXTERNAL } :{ config .get_edge_port_http ()} /{ bucket_name } /"
170
- return f"{ config .get_protocol ()} ://{ bucket_name } .s3.{ LOCALHOST_HOSTNAME } :{ config .get_edge_port_http ()} /"
169
+ host_definition = localstack_host (use_hostname_external = True )
170
+ return f"{ config .get_protocol ()} ://{ host_definition .host_and_port ()} /{ bucket_name } /"
171
+ else :
172
+ host_definition = localstack_host (use_localhost_cloud = True )
173
+ return f"{ config .get_protocol ()} ://{ bucket_name } .s3.{ host_definition .host_and_port ()} /"
171
174
172
175
173
176
class S3Provider (S3Api , ServiceLifecycleHook ):
You can’t perform that action at this time.
0 commit comments