-
Notifications
You must be signed in to change notification settings - Fork 212
Add runtime option to associate secrets to functions #1018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…-functions into dl-cf3-secrets
src/cloud-functions.ts
Outdated
options, | ||
'secretEnvironmentVariables', | ||
'secrets', | ||
(secrets) => secrets.map((secret) => ({ secret })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the fully qualified names/versions gets weird because we agreed elsewhere that we'd be setting key
and not secret
so that we could bind later. I guess we can, in this case, bind both and not bind secret
in the params case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's good point.
I've been thinking the opposite - that v1 Functions SDK will receive secret and the CLI will bind the env key using the secret name. With params context, having the option to later bind the secret makes sense.
Being restrictive here - to set both key
and secret
to the secret input is good and letting params be the one that only binds the secret
makes more sense to me.
Google Cloud Functions (GCF) now have support for loading secrets stored in Secret Manager to securely access application secrets (e.g. Third party API keys) on function executions. See the [documentations(https://cloud.google.com/functions/docs/configuring/secrets) for more details.
We propose extending the function runtime option to associate secrets. Then, the secrets can be access as an environment once deployed to GCF: