gpt4 book ai didi

python - 谷歌云函数部署 "allow unauthenticated invocations..."

转载 作者:行者123 更新时间:2023-12-03 09:36:26 31 4
gpt4 key购买 nike

每当我必须使用 gcloud 部署新的 python 函数时sdk 我收到这条消息

Allow unauthenticated invocations of new function [function-name]?

(y/N)?

WARNING: Function created with limited-access IAM policy. To enable unauthorized access consider

"gcloud alpha functions add-iam-policy-binding function-name --region=europe-west1 --member=allUsers --role=roles/cloudfunctions.invoker"


是否有任何标志可以添加到命令中以使其成为 NO部署时?
这是我用来部署一个函数的示例命令:
gcloud functions deploy function-name --region=europe-west1 --entry-point function-entry-point --trigger-resource "projects/my-project/databases/(default)/documents/user_ids/{user_id}" --trigger-event providers/cloud.firestore/eventTypes/document.create --runtime python37 --timeout 60 --project my-project

最佳答案

来自 https://cloud.google.com/sdk/docs/scripting-gcloud#disabling_prompts :

You can disable prompts from gcloud CLI commands by setting the disable_prompts property in your configuration to True or by using the global --quiet or -q flag.



因此,对于您的示例,您可以运行:
gcloud functions deploy function-name --quiet --region=europe-west1 --entry-point function-entry-point --trigger-resource "projects/my-project/databases/(default)/documents/user_ids/{user_id}" --trigger-event providers/cloud.firestore/eventTypes/document.create --runtime python37 --timeout 60 --project my-project

关于python - 谷歌云函数部署 "allow unauthenticated invocations...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61552469/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com