aws / aws/aws-extensions-for-dotnet-cli

Add options for pre-commands and environment variables to lambda package command

Open
#329 5 comments 0 reactions 0 assignees View on GitHub
feature-request module/cli-ext p2 queued
Dominant language
C#
Stars
393
Forks
90
Avg merge
2d 19m
Merged PRs (30d)
3

Description

### Describe the feature

Add an option which will allow you to specify a set of commands to be pre-pended prior to the dotnet publish command when using package. Additionally it would be really useful to be able to specify additional environment variables sent to the docker container that is ran.

### Use Case

When using a private NuGet feed, we need to make use of appropriate PAT tokens or credentials. In our specific use case we'd like to use the Azure Artifacts Credential Provider, but this requires some installation and setup prior to the dotnet publish command.

In the case of the installation, I'm aware we can go ahead take the base image, add what additional tools we need, and then use the -cifb switch to specify the appropriate container. But this is only part of the problem, in order to use the credentials provider we need to specify additional environment variables namely VSS_NUGET_EXTERNAL_FEED_ENDPOINTS which currently as far as I can see the CLI does not support us providing as part of the build.

For context the above is in reference to a .NET 8 AOT Native build.

The only workaround that I can see currently, is to specify the credentials in plaintext in the Nuget.Config file at the root of the project prior to running the dotnet lambda package command, which is not ideal.

### Proposed Solution

_No response_

### Other Information

_No response_

### Acknowledgements

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

### Targeted .NET platform

8.0.303

### CLI extension version

5.10.7

### Environment details (OS name and version, etc.)

MacOS Sonoma 14.5

Contributor guide

Open the contributing guide

Research direction

Locate the implementation of the dotnet lambda package command and the Docker container invocation it uses. Trace how the dotnet publish command is assembled and how container environment variables are passed. Done means users can provide pre-commands and additional environment variables without storing credentials in NuGet.Config, with coverage for the requested packaging scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, docker
Domain
build-system, cli, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.