Alex Williams
Alex Williams

Reputation: 189

Set Firebase Functions Security Level From Command Line

I'm deploying a firebase HTTP function using the command line and would like to change the security-level to 'secure-always' like you can do in the gcloud deploy command:

gcloud functions deploy FUNCTION_NAME --trigger-http --security-level=secure-always

I cannot use the UI to deploy this function (I do not store my source code on source repos), and am in a Firebase functions directory so I cannot use gcloud to deploy. Is there a gcloud command I can use to edit the function's security-level after deployment similar to:

gcloud functions remove-iam-policy-binding

or a way to specify the security-level pre-deployment? For reference I am deploying a NodeJS Cloud Function and using firebase deploy --only functions:FUNCTION_NAME. My current fallback option is manually examining the headers in the function, as it is the only option described in this docs page available in my situation: https://cloud.google.com/functions/docs/writing/http#security_levels

Upvotes: 1

Views: 275

Answers (1)

JM Gelilio
JM Gelilio

Reputation: 3766

So far, there's no gcloud command to update the Cloud Function's security level from HTTP to HTTPS. For now, you can only update the Cloud Function's security level by re-deploying the function or edit the function through Google Cloud Function Console:

  1. Click the prefer Function
  2. Click Edit button
  3. At the bottom of Trigger title, click the edit button
  4. Check or tick the check box of Require HTTPS and click Save button
  5. Click the Next button at the bottom of screen and deploy.

Upvotes: 2

Related Questions