Skip to content

Allow setting msbuild parameters in CloudFormation template #213

@normj

Description

@normj

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.

"Function": {
    "Type": "AWS::Serverless::Function",
    "Properties": {
    "PackageType": "Image",
...
    },
    "Metadata": {
      "Dockerfile": "Dockerfile",
      "DockerContext": ".",
      "DockerTag": ""
    }
}

We should follow a similar pattern for producing the .NET zip bundle. Something like the following.

"Function": {
    "Type": "AWS::Serverless::Function",
    "Properties": {

...
    },
    "Metadata": {
      "BuildConfiguration": "CustomRelease",
      "MSBuildParameters": "/p:SpecialLambdaOptization=true"
    }
}

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Targeted .NET platform

Any version the tool supports

CLI extension version

No response

Environment details (OS name and version, etc.)

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions