Looks like I have to redeploy my google function if I want to change the "Runtime environment variables".
Is there a way to update without redeploying?
No, there is no way to update the environment variable without redeploying. The principle is to keep a version consistent. Like this, in case of issue in the new version, you can go back to the previous one. It's the principle for a quick rollback.
Sadly, Cloud Functions not yet allow to go back to a previous version (but it should be in the roadmap, I discussed this months ago with a PM). Cloud Run and App Engine allow this rollback, based on this principle, it's a good practice.
At a DevOps perspective, a change in the Env var is a push in your repo, a new CI/CD job and thus a new deployment.
To update a variable using the Google Cloud CLI, use the --update-env-vars flag at deploy time:
gcloud functions deploy FUNCTION_NAME --update-env-vars FOO=bar
Learn more about it here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With