3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Next.jsをFirebaseにCI/CDするときCaller is missing permission 'iam.serviceaccounts.actAs' on service accountエラーになる

Posted at

はじめに

Next.jsをFirebaseにCDをするさいにGCPの権限でつまづいたのでまとめます

問題

$ firebase deploy

をすると以下のようなエラーが発生して失敗しました

⚠  functions: HTTP Error: 403, Caller is missing permission 'iam.serviceaccounts.actAs' on service account projects/-/serviceAccounts/407119337190-compute@developer.gserviceaccount.com.Grant the role 'roles/iam.serviceAccountUser' to the caller on the service account projects/-/serviceAccounts/407119337190-compute@developer.gserviceaccount.com.You can do that by running 'gcloud iam service-accounts add-iam-policy-binding projects/-/serviceAccounts/407119337190-compute@developer.gserviceaccount.com --member MEMBER --role roles/iam.serviceAccountUser'where MEMBER has a prefix like 'user:' or 'serviceAccount:'.Details and instructions for the Cloud Console can be found at 

解決方法

権限を追加することで解決しました

GCPの「IAM」から作成したサービスアカウントの鉛筆マークをクリック

image.png

iam.serviceAccountUser(サービスアカウントユーザー)を追加

image.png

これでうまくいくようになりました

おわりに

かなり沼りましたがなんとかいきました
どのアカウントにロールをつけるかが大切でした

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?