问题描述
我已启用API <ng-container *ngIf="type">
<ng-container [ngSwitch]="type" [formGroup]="formGroup"> <!-- <== pass injected form -->
<ng-container *ngSwitchCase="'mycustomtype'">
<input type="text" [formControlName]="formControlName" class="form-control" />
</ng-container>
<ng-container *ngSwitchDefault>
<input type="number" [formControlName]="formControlName" class="form-control" />
</ng-container>
</ng-container>
</ng-container>
,但未创建GCP托管服务帐户Cloud Asset API (cloudasset.googleapis.com)
。我已经在多个地方阅读过GCP应该创建该帐户的信息。
我曾多次尝试启用/禁用API,但还是没有运气。
如果有人知道解决方法,请告诉我:-)
解决方法
存在!但是它没有允许。只需转到IAM页面,单击+ ADD。在电子邮件中填入Cloud Asset服务帐户电子邮件:service-{projectNumber}@gcp-sa-cloudasset.iam.gserviceaccount.com
。并至少添加角色Cloud Asset Service Agent
。保存。
遇到了类似的问题,我可以看到 service-{projectNumber}@gcp-sa-cloudasset.iam.gserviceaccount.com
形式的服务帐户确实已创建,但我无法为其分配角色,因为我遇到了这个令人困惑(错误)的错误({ {1}})。
我发现镇上有一项新政策禁止使用跨项目服务帐户权限:https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts。
mail addresses and domains must be associated with an active Google Account,G Suite account,or Cloud Identity account.
应该可以解决它。
应该更新文档,但是在激活API时而不是在运行导出时创建服务帐户。因此,如果您运行资产的导出,则将显示服务帐户。
如果由于某种原因而无法运行导出(例如,当您要创建资产供稿以监视更改时),则可以运行以下命令:
gcloud beta services identity create --service=cloudasset.googleapis.com --project=PROJECT_ID
在Terraform中,我创建了一个可以解决问题的null_resource
。