@@ -233,12 +233,17 @@ def get_enabled_apis() -> Set[str]:
233233 services = SERVICE_PLUGINS .list_available ()
234234
235235 if services_env and is_env_true ("STRICT_SERVICE_LOADING" ):
236- from localstack .services .plugins import SERVICE_PLUGINS
237-
238236 # SERVICES and STRICT_SERVICE_LOADING are set
239237 # we filter the result of SERVICE_PLUGINS.list_available() to cross the user-provided list with
240238 # the available ones
241- services = [service for service in services_env .split ("," ) if service in services ]
239+ enabled_services = []
240+ for service_port in re .split (r"\s*,\s*" , services_env ):
241+ # Only extract the service name, discard the port
242+ parts = re .split (r"[:=]" , service_port )
243+ service = parts [0 ]
244+ enabled_services .append (service )
245+
246+ services = [service for service in enabled_services if service in services ]
242247 # TODO: log a message if a service was not supported? see with pro loading
243248
244249 return resolve_apis (services )
@@ -263,7 +268,12 @@ def get_preloaded_services() -> Set[str]:
263268 if services_env and is_env_true ("EAGER_SERVICE_LOADING" ):
264269 # SERVICES and EAGER_SERVICE_LOADING are set
265270 # SERVICES env var might contain ports, but we do not support these anymore
266- services = [service for service in services_env .split ("," )]
271+ services = []
272+ for service_port in re .split (r"\s*,\s*" , services_env ):
273+ # Only extract the service name, discard the port
274+ parts = re .split (r"[:=]" , service_port )
275+ service = parts [0 ]
276+ services .append (service )
267277
268278 if not services :
269279 from localstack .services .plugins import SERVICE_PLUGINS
@@ -274,7 +284,16 @@ def get_preloaded_services() -> Set[str]:
274284
275285
276286def should_eager_load_api (api : str ) -> bool :
277- return api in get_preloaded_services ()
287+ apis = get_preloaded_services ()
288+
289+ if api in apis :
290+ return True
291+
292+ for enabled_api in apis :
293+ if api .startswith (f"{ enabled_api } :" ):
294+ return True
295+
296+ return False
278297
279298
280299def start_infra_locally ():
0 commit comments