-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: Add support for secrets manager environment variables #287
feat: Add support for secrets manager environment variables #287
Conversation
These docs rely on serverless/serverless-google-cloudfunctions#287 to be merged
c93b0a6
to
5c81b7a
Compare
5c81b7a
to
e4a0609
Compare
Hello @christophersjchow - could you please link to the documetation that shows how that secrets data should be passed? It would help me better understand how we could shape it to be convenient for the plugin users |
@pgrzesik The resource for the Cloud Function is described here in the REST API reference: https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions In there there's a field:
Which links to the That describes the object structure as:
I tested this locally by linking this package into one of our projects and successfully deployed through Deployment manager. |
Any chance you could approve me for GitHub Actions too so CI will run? |
Thanks a lot for the update @christophersjchow - I won't be able to look at it more closely this week, but I will find some time for it at the beginning of the next week. |
e4a0609
to
38eb21f
Compare
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.
Sorry for the delay @christophersjchow - I was swamped with other priorities - it looks good in general, but I'm afraid we need to figure out the best representation of this setting in serverless configuration - could you propose how it could look like?
38eb21f
to
ef192df
Compare
@pgrzesik The PR simply passes it through to the Deployment manager config. Here is an example as per the docs I've added here: serverless/serverless#10660 I think leaving the options the same as what Deployment Manager would expect is reasonable here, as this relies heavily on those specific options. The ID of the secret, version of the secret and the environment variable
The config on the serverless side allows for an array of secrets to be set. From the docs PR: provider:
secrets:
- key: 'API_KEY'
secret: 'secret-id'
version: 'latest'
projectId: 'project-id' # Optional, defaults to function project |
ef192df
to
5e094a5
Compare
@pgrzesik I can see that there's a call for maintainers for this plugin. I'd be willing to help out. |
@pgrzesik This future is super helpful. Currently, I can't set secret env variable out of the scope of the serverless deployment. Environment variables that are set manually are overridden by the next deployment. The implementation looks good, let's merge and release it :) |
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.
Hey @christophersjchow - sorry for the delay - I was unavailable for a past few days. The implementation looks good to me, let's merge it 👍
Add support for setting environment variables that pull from Secrets Manager.
I basically copied the pattern that environment variables are currently being set so would appreciate anything I've missed.