@@ -29,6 +29,7 @@ def generate_makefile_rule_for_lambda_resource(
2929 terraform_application_dir : str ,
3030 python_command_name : str ,
3131 output_dir : str ,
32+ mount_symlinks : bool = False ,
3233) -> str :
3334 """
3435 Generates and returns a makefile rule for the lambda resource associated with the given sam metadata resource.
@@ -56,7 +57,12 @@ def generate_makefile_rule_for_lambda_resource(
5657 resource_address = sam_metadata_resource .resource .get ("address" , "" )
5758 python_command_recipe = _format_makefile_recipe (
5859 _build_makerule_python_command (
59- python_command_name , output_dir , resource_address , sam_metadata_resource , terraform_application_dir
60+ python_command_name ,
61+ output_dir ,
62+ resource_address ,
63+ sam_metadata_resource ,
64+ terraform_application_dir ,
65+ mount_symlinks = mount_symlinks ,
6066 )
6167 )
6268 return f"{ target } { python_command_recipe } "
@@ -124,6 +130,7 @@ def _build_makerule_python_command(
124130 resource_address : str ,
125131 sam_metadata_resource : SamMetadataResource ,
126132 terraform_application_dir : str ,
133+ mount_symlinks : bool = False ,
127134) -> str :
128135 """
129136 Build the Python command recipe to be used inside of the Makefile rule
@@ -155,12 +162,15 @@ def _build_makerule_python_command(
155162 terraform_built_artifacts_script_path = convert_path_to_unix_path (
156163 str (Path (output_dir , TERRAFORM_BUILD_SCRIPT ).relative_to (terraform_application_dir ))
157164 )
158- return show_command_template .format (
165+ command = show_command_template .format (
159166 python_command_name = python_command_name ,
160167 terraform_built_artifacts_script_path = terraform_built_artifacts_script_path ,
161168 jpath_string = jpath_string .replace ('"' , '\\ "' ),
162169 resource_address = resource_address .replace ('"' , '\\ "' ),
163170 )
171+ if mount_symlinks :
172+ command += " --mount-symlinks"
173+ return command
164174
165175
166176def _get_makefile_build_target (logical_id : str ) -> str :
0 commit comments