aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

aws lambda update-function-configuration: Add --env-file option

Open franciscocpg opened this issue 8 years ago • 17 comments

often I have this boilerplate code in a shell script:

source .env

aws lambda update-function-configuration \
--region "$REGION" \
--function-name "$FUNCTION_NAME" \
--environment Variables="{\
VAR1=$VAR1,\
VAR2=$VAR2,\
VAR3=$VAR3,\
VAR4=$VAR4,\
(...)
}" > /dev/null

It would be nice if I could do this instead:

aws lambda update-function-configuration \
--region "$REGION" \
--function-name "$FUNCTION_NAME" \
--env-file .env

I'm not a python dev but if you are open to contributions and consider that this feature request makes sense I can propose a PR.

franciscocpg avatar Aug 23 '18 16:08 franciscocpg

@franciscocpg - thanks for reaching out. In general, currently the CLI works with JSON formats. As such, there is a blog posting that goes into more detail regarding the feature you trying to work with:
Best Practices for Local File Parameters

Please advise if this works for you.

justnance avatar Aug 31 '18 09:08 justnance

Hi @justnance Thanks for your response.

It does not work because the idea is to keep .env file (using its format) usable across multiples projects/frameworks.

Eg: The .env file with contents:

VAR1=Value1
VAR2=Value2

would be usable by my nodejs project, by docker-compose (https://docs.docker.com/compose/compose-file/#env_file) and by aws cli.

Since .env files are widely used across different projects/frameworks to define environment variables I thought that aws cli could support it too.

franciscocpg avatar Sep 03 '18 17:09 franciscocpg

@franciscocpg - Thank you for your feedback. I am labeling this as a feature request pending additional 👍 .

justnance avatar Sep 24 '18 17:09 justnance

+1

garrington avatar Oct 16 '18 22:10 garrington

+1

moamenet avatar Nov 20 '18 15:11 moamenet

+1

tyronegroves avatar Nov 29 '18 20:11 tyronegroves

+1

fizz avatar Dec 19 '18 01:12 fizz

+1

eschizoid avatar Jan 14 '19 15:01 eschizoid

+1

ravinatesan avatar Mar 05 '19 22:03 ravinatesan

+1

machaerus avatar Jul 16 '19 15:07 machaerus

+1

griddyphillip avatar Mar 09 '20 18:03 griddyphillip

+1

Zepp10x avatar Mar 17 '20 18:03 Zepp10x

+1

konstk1 avatar Apr 09 '20 02:04 konstk1

+1

juyalpriyank avatar Apr 18 '20 10:04 juyalpriyank

+1

agarwalashish avatar May 17 '20 11:05 agarwalashish

+1

ghost avatar May 19 '21 11:05 ghost

Rather than adding a "+1" comment, we recommend adding a 👍 to the original post in order to help the team better track the demand of feature requests such as these.

My first thought was that this feature request should be redirected to the Lambda team, so that they could consider adding this ability to the underlying UpdateFunctionConfiguration API. But to add a --env-file option specifically for the CLI would involve creating a customization for this command, and I wonder if there are use cases involving other services/commands that might benefit from this ability as well.

tim-finnigan avatar Nov 08 '22 23:11 tim-finnigan