You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish sam build would not clear the build directory when building a specific lambda function in my template.
Proposal
Currently, running sam build clears the build directory and builds all the functions and layers in the template. There is an option to build a specific function in the template: sam build [OPTIONS] FUNCTION_RESOURCE_NAME
Running this command will clear the build directory and build only the function specified by FUNCTION_RESOURCE_NAME. I was hoping I could use this to build my functions separately. You could have, for instance, a Makefile with multiple rules. Each of which builds one specific function, but only if its source code has changed since the last build (I use so called 'empty targets' to keep track of the last build time). However, if multiple functions have changes and I try to build and deploy my functions, this happens:
sam build Function1
sam build Function2 # Wipes the build directory. Function1 is gone now.
sam deploy
I am not sure how to handle the situation where you deploy your sam app without building all of your functions first. From what I've experienced, sam seems to just copy your CodeUri directory and use it as the deployment package.
The text was updated successfully, but these errors were encountered:
Describe your idea/feature/enhancement
I wish sam build would not clear the build directory when building a specific lambda function in my template.
Proposal
Currently, running
sam build
clears the build directory and builds all the functions and layers in the template. There is an option to build a specific function in the template:sam build [OPTIONS] FUNCTION_RESOURCE_NAME
Running this command will clear the build directory and build only the function specified by FUNCTION_RESOURCE_NAME. I was hoping I could use this to build my functions separately. You could have, for instance, a Makefile with multiple rules. Each of which builds one specific function, but only if its source code has changed since the last build (I use so called 'empty targets' to keep track of the last build time). However, if multiple functions have changes and I try to build and deploy my functions, this happens:
Things to consider:
No
Additional Details
I am not sure how to handle the situation where you deploy your sam app without building all of your functions first. From what I've experienced, sam seems to just copy your
CodeUri
directory and use it as the deployment package.The text was updated successfully, but these errors were encountered: