Open cj-mantas-gridinas opened 1 month ago
This kind of sounds like an edge case we did just never considered: ie. what happens if we skip the build, but also pass in the function explicitly to build.
I just wanted to ask about your use case, since sam build
will still create an output template with other resources when specifying an explicit resource to build. It just won't build the other resources.
My usecase is to run lambdas via intellij with aws toolkit plugin. The plugin runs 2 commands sequentially - build
, with explicit lambda name, and local invoke
with output template and other resources that would be produced by the build command. The plugin isn't something made by community either. It's provided by AWS (verified, too).
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
The original problem stems from SAM trying to guess what build tool is being used, trying to invoke it, and expecting a partcular file to be present after the build. In the provided case, SAM would expect the result to be a fat jar, instead of a zip of jars, which is a valid deployment in regular lambdas. Just moving the zip file to ARTIFACT_DIR (in makefile configuration) isn't enough, as you must extract it.
Description:
Setting the skip build flag only affects lambda builds if you do not specify which lambda should be built using the build subcommand.
Steps to reproduce:
Resources.lambda.Metadata.SkipBuild
to Truesam build --template template.yml lambda
Example template.yml file
Used the following build.gradle to show as proof that the build is still run.
Observed result:
Expected result:
Build is skipped regardless of naming the lambda or not as that is how the aws toolkit idea plugin works
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.121