aws / aws-extensions-for-dotnet-cli

Extensions to the dotnet CLI to simplify the process of building and publishing .NET Core applications to AWS services
Apache License 2.0
371 stars 87 forks source link

Support for parameter overrides in CFn templates #159

Open NickDarvey opened 3 years ago

NickDarvey commented 3 years ago

I see that template parameters are supported via an argument: https://github.com/aws/aws-extensions-for-dotnet-cli/blob/1877efebcf77c05e795911317ca1d32931dbd372/src/Amazon.Lambda.Tools/Commands/DeployServerlessCommand.cs#L579

However it would be great if you were also able to refer to a file, similar to the AWS CLI.

e.g. something like:

dotnet lambda deploy-serverless --template-parameters file://parameters.my-stack-prod.json

which is similar to:

aws cloudformation deploy --template stack.yaml --stack-name my-stack --parameter-overrides file://parameters.my-stack-prod.json
ashishdhingra commented 2 years ago

Needs review with the team.

madmox commented 2 years ago

I find the current --template-parameters syntax to be quite a pain to use, since you have to escape both \ and " characters from each parameter key and value. I was happy to be able to use the file:// syntax with aws cloudformation deploy, only to find out dotnet lambda deploy-serverless does not support it.

It's a real shame, because it means we have to handle the stack settings differently depending on a lot of factors: the CLI we are going to use for the deployment (aws cloudformation or dotnet lambda), and the OS/shell we are deploying from (Linux bash for CI servers and Windows powershell for dev machines). It would be a lot simpler to be able to pass in the path of a JSON file for all cases.