Open mattcorey opened 2 months ago
Thank you for having submitted this. I agree that we should document how to nicely integrate with sam
native way of managing the build. Makefile
is indeed part of the solution.
I have developed SAM Makefile for Swift last year (see https://github.com/swift-server-community/aws-lambda-swift-sam-template/blob/main/templates/api-to-lambda/%7B%7Bcookiecutter.__project_name%7D%7D/Makefile)
I will modify the doc and the example code to ensure this use case is correctly supported and documented.
AWS SAM seems to have evolved since the documentation and examples have been written, and we could benefit from guidance in taking advantage of features like Makefile builds, 'sam sync' and 'sam local start-api'
I've created a Makefile build that works reasonably well, and takes advantage of incremental builds, but it doesn't work with the 'sam sync' command (it continuously builds and deploys).
Below is my template.yaml and Makefile - with this, I can use the following commands:
template.yaml:
Makefile (changing into the WORKING_DIR each time to use incremental builds -
sam build
creates a new temp directory with each build):