Skip to content
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

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

Open
2 tasks
tim-hampton opened this issue Apr 10, 2024 · 2 comments
Open
2 tasks
Assignees
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@tim-hampton
Copy link

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 tim-hampton added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 10, 2024
@ashishdhingra
Copy link
Contributor

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 ashishdhingra added needs-review p2 This is a standard priority issue queued and removed needs-triage This issue or PR still needs to be triaged. needs-review labels Apr 11, 2024
@ashishdhingra
Copy link
Contributor

@tim-hampton Good afternoon. Did you try using --config-file with value as the relative path from the project location? The default config is resolved here, where defaults are loaded via call to LoadDefaults() using project location and relative path to config file.

Using dotnet lambda deploy-function --config-file bin\QA\test\aws-lambda-tools-defaults.json appears to work per below screenshot from extensions tooling debugger:

Image

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 22, 2025
@ashishdhingra ashishdhingra self-assigned this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants