如何恢复GCP项目服务帐户

时间:2020-07-30 15:02:37

标签: google-cloud-platform cloud dialogflow-es

我无知地将服务帐户删除到我的GCP项目中,而不是将服务帐户删除到Google Calendar API和Dialogflow服务帐户中。

我现在在尝试通过嵌入式代码编辑器将我的dialogflow代理部署到Cloud Functions时遇到问题。 当我检查日志时,收到以下消息:

2020-07-30 15:48:40.350 WAT
Dialogflow API
CreateCloudFunction
us-central1
bashorun.emma@gmail.com
userFacingMessage: 
Default service account 'northern-timer-231210@appspot.gserviceaccount.com' doesn't exist. 
Please recreate this account (for example by disabling and enabling the Cloud Functions API),
or specify a different account.;
com.google.cloud.eventprocessing.manager.api.error.DefaultServiceAccountDoesNotExistException: userFacingMessage:
Default service account 'northern-timer-231210@appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; Code: FAILED_PRECONDITION com.google.apps.framework.request.StatusException: <eye3 title='FAILED_PRECONDITION'/> generic::FAILED_PRECONDITION: userFacingMessage:
Default service account 'northern-timer-231210@appspot.gserviceaccount.com' doesn't exist. 
Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; com.google.cloud.eventprocessing.manager.api.error.DefaultServiceAccountDoesNotExistException: userFacingMessage: 
Default service account 'northern-timer-231210@appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.; Code: FAILED_PRECONDITION

是否可以找回服务帐户,或者由于其他问题而出现这些错误?

1 个答案:

答案 0 :(得分:2)

删除服务帐户后,您可以recover在删除服务帐户后的30天之内。

为此,您可以从云外壳运行以下command

gcloud beta iam服务帐户取消删除ACCOUNT_ID

可以使用以下过滤器从stackdriver logging获取帐户ID

resource.type =“ service_account” resource.labels.email_id =“服务帐户名称” “ DeleteServiceAccount”

希望这有助于恢复您的服务帐户。