aws-extensions-for-dotnet-cli icon indicating copy to clipboard operation
aws-extensions-for-dotnet-cli copied to clipboard

Ability to set the location of the tools-defaults.json file the publish tool uses

Open tim-hampton opened this issue 10 months ago • 1 comments

Describe the feature

We would like the ability to set the folder path (relative to the current project folder) that the publish tool uses, instead of it being hard-coded to the project-level folder.

Use Case

We have an AWS Lambdas SAM project that we want to be able to deploy to multiple stages (Dev, QA, Prod). Using something like SlowCheetah to transform the contents of the aws-lambda-tools-defaults.json file that we'd output to our build output folder (e.g. bin\QA\net6.0\), we'd like to tell the publish tool to look in that folder for the aws-lambda-tools-defaults.json file instead of the project-level source folder.

Without being able to transform the aws-lambda-tools-defaults.json file and use that transformed file instead of the one created by the project, I'm frustrated that we are forced to place all of the stages' relevant parameter/value pairs in the same project-level file, leaving only one stage uncommented and the other two stages' parameters commented out, just so that we don't have to hunt down the appropriate parameter values every time we need to deploy to a certain stage.

Proposed Solution

No proposed solution, however I would imagine that the solution would have to default to the current file's location if a ...tools-defaults.json file could not be found in the designated folder path upon opening the publish tool window, as a fallback plan.

Other Information

Our only real workaround is to include all the relevant values for the parameters, for all three stages, in the project-level file and uncomment the set of parameters needed for publishing to a given stage. This is less than ideal, and might prevent us from being able to automate our deployments through an Azure DevOps release pipeline, although this is a minor concern at the moment.

Acknowledgements

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

Targeted .NET platform

.Net 6+

CLI extension version

dotnet tool list -g Package Id Version Commands


amazon.lambda.testtool-3.1 0.12.7 dotnet-lambda-test-tool-3.1 amazon.lambda.testtool-6.0 0.15.1 dotnet-lambda-test-tool-6.0 amazon.lambda.tools 5.9.0 dotnet-lambda dotnet-reportgenerator-globaltool 5.2.0 reportgenerator upgrade-assistant 0.4.355802 upgrade-assistant

Environment details (OS name and version, etc.)

Windows 10

tim-hampton avatar Apr 10 '24 23:04 tim-hampton

Needs review with the team.

The defaults from aws-lambda-tools-defaults.json are loaded here, which uses Utilities.DetermineProjectLocation() to get the .NET project location.

ashishdhingra avatar Apr 11 '24 17:04 ashishdhingra