-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting msbuild parameters in CloudFormation template #213
Comments
I would support that. Currently, if you are using |
@paul-michalik |
@chrisoverzero No, it does not. Trying with v1.55, it happily ignores the "aws-lambda-tools-defaults.json" in the project directory or in the global solution directory, no matter where I put it. |
Ah, I think I see the confusion. It does pick up that file in those locations with many of its settings, as I've confirmed from testing, but it doesn't read the "msbuild-parameters" setting upon |
Hm, but the settings are only useful for "sam build", afterwards they are irrelevant. Which settings are picked during "sam build"? There seems to be a plenty which could be useful. |
Unless the architecture has changed since I last looked, All that aside, I really like this proposal! |
Yes, I use "Directory.Build.Props" too, in order to set common properties for all projects in a common "devkit", which typically is a solution container (I often share projects across solutions). Dotnet tooling respects this if you invoke dotnet commands or MSBuild according to common rules. However, "sam build" does not play by my rules, and I don't see many possibilities to tweak it, except: 1) add makefile metadata to the CloudFormation template 2) package the code myself and only reference the resulting zip file in the CodeUri in the temple, which works although it is not a documented behavior therefore I don't want to rely on it. I'll debug through the "sam build" in order to see how exactly they invoke "dotnet lambda". The actual problem is the "dotnet publish" invocation which somehow completely ignores the project settings and even my custom targets from *.props files. This is only possible, if they invoke it from a custom working directory which prevents MSBuild tooling to search for *. props. |
Describe the feature
When deploying a function straight to the Lambda service using the
dotnet lambda deploy-function
command users can specific additional MSBuild parameters passing in the--msbuild-parameters
switch. When deploying via CloudFormation the project being built is being decided via the location of the project specified in the template via the Code properties. In this context there is not hook for the user to specify additional MSBuild parameters.Use Case
For projects that need to pass in additional MSBuild configuration to build correctly for their Lambda deployments.
Proposed Solution
When building container based functions the Lambda function's metadata in the template contains docker build information.
We should follow a similar pattern for producing the .NET zip bundle. Something like the following.
Other Information
No response
Acknowledgements
Targeted .NET platform
Any version the tool supports
CLI extension version
No response
Environment details (OS name and version, etc.)
Any
The text was updated successfully, but these errors were encountered: