Reputation: 12848
How can I use a secret when creating a 2nd gen Cloud Function?
When I create a 1st generation Cloud Function, I can add secrets like so:
However this option is not available when creating a 2nd generation Cloud Function:
Upvotes: 1
Views: 585
Reputation: 12848
When you create a 2nd generation Cloud Function, you actually create a Cloud Run.
So after the creation of your function go to Cloud Run, find the function you created, click on Edit & Deploy new revision and then add the references to the secret you need:
Upvotes: 2