@@ -101,6 +101,7 @@ def __init__(
101101 invoke_images : Optional [str ] = None ,
102102 mount_symlinks : Optional [bool ] = False ,
103103 no_mem_limit : Optional [bool ] = False ,
104+ container_dns : Optional [Tuple [str ]] = None ,
104105 function_logical_ids : Optional [Tuple [str , ...]] = None ,
105106 ) -> None :
106107 """
@@ -158,6 +159,8 @@ def __init__(
158159 Optional. A dictionary that defines the custom invoke image URI of each function
159160 mount_symlinks bool
160161 Optional. Indicates if symlinks should be mounted inside the container
162+ container_dns tuple
163+ Optional. Tuple of DNS server IP addresses for the container
161164 function_logical_ids tuple(str)
162165 Optional. Tuple of function logical IDs to filter and make available for local execution.
163166 Used by 'sam local start-api' and 'sam local start-lambda' commands to limit which
@@ -188,6 +191,7 @@ def __init__(
188191 self ._debug_args = debug_args
189192 self ._debugger_path = debugger_path
190193 self ._container_env_vars_file = container_env_vars_file
194+ self ._container_dns = container_dns
191195
192196 self ._parameter_overrides = parameter_overrides
193197 # Override certain CloudFormation pseudo-parameters based on values provided by customer
@@ -356,6 +360,7 @@ def initialize_function_container(function: Function) -> None:
356360 container_host = self ._container_host ,
357361 container_host_interface = self ._container_host_interface ,
358362 extra_hosts = self ._extra_hosts ,
363+ container_dns = self ._container_dns ,
359364 )
360365
361366 # Collect container ID in a thread-safe way
@@ -610,6 +615,7 @@ def local_lambda_runner(self) -> LocalLambdaRunner:
610615 container_host = self ._container_host ,
611616 container_host_interface = self ._container_host_interface ,
612617 extra_hosts = self ._extra_hosts ,
618+ container_dns = self ._container_dns ,
613619 )
614620 return self ._local_lambda_runner
615621
0 commit comments