diff --git a/samcli/commands/local/start_api/cli.py b/samcli/commands/local/start_api/cli.py index 0ef1ef5c52..cba1ebe7ea 100644 --- a/samcli/commands/local/start_api/cli.py +++ b/samcli/commands/local/start_api/cli.py @@ -203,6 +203,7 @@ def do_cli( # pylint: disable=R0914 debug_function, container_host, container_host_interface, + add_host, invoke_image, hook_name, ssl_cert_file, @@ -251,6 +252,7 @@ def do_cli( # pylint: disable=R0914 container_host=container_host, container_host_interface=container_host_interface, invoke_images=processed_invoke_images, + add_host=add_host, ) as invoke_context: ssl_context = (ssl_cert_file, ssl_key_file) if ssl_cert_file else None service = LocalApiService( diff --git a/tests/unit/commands/local/start_api/test_cli.py b/tests/unit/commands/local/start_api/test_cli.py index f19dbeff76..1860dd66c0 100644 --- a/tests/unit/commands/local/start_api/test_cli.py +++ b/tests/unit/commands/local/start_api/test_cli.py @@ -51,6 +51,7 @@ def setUp(self): self.ssl_cert_file = None self.ssl_key_file = None self.static_dir = "staticdir" + self.add_host = [] self.container_host = "localhost" self.container_host_interface = "127.0.0.1" @@ -94,6 +95,7 @@ def test_cli_must_setup_context_and_start_service(self, local_api_service_mock, shutdown=self.shutdown, container_host=self.container_host, container_host_interface=self.container_host_interface, + add_host=self.add_host, invoke_images={}, ) @@ -225,4 +227,5 @@ def call_cli(self): ssl_cert_file=self.ssl_cert_file, ssl_key_file=self.ssl_key_file, disable_authorizer=self.disable_authorizer, + add_host=self.add_host, )