How to export environment variables from a Lambda function.

0

Hello, I have created a Lambda function that fetched the static/hash token from the environment variables in the Configuration section. When I try to export the Lambda function using the Action > Export function, a zip file is downloaded without any configuration-related data in it. Is there a way to export the environment variables from the Lambda functions?

1 Answer
2

As referred in this documentation, you can obtain all the configuration details for the function through the AWS CLI like this:

aws lambda get-function-configuration --function-name <value> --output json

You can use the output to update the new function using this command:

aws lambda update-function-configuration --function-name <value> --cli-input-json <output from previous command>

You may need to change the output as needed before using it for the update-function-configuration invocation.

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions