No permission to create an App Engine application - google-app-engine

I'm facing some permission problems with the google cloud. Whenever I try to setup a new app engine, I receive the following message:
You don't have permission to create an App Engine application in this project.
According to our administrator, all available app engine roles are assigned to my account.
Any ideas?
Greetings,
Sebastian

You need this permission:
appengine.applications.create
If you try to create an appit within the console:
~ $ gcloud app create
you will get exactly the this permission role missing but incredibly this permission is not assigned by default to the administrator.
Thus, either create a new Role with this permission or just add this permissions to any role you already have

You probably have an IAM role on the project that doesn't include access to App Engine.
https://cloud.google.com/iam/docs/understanding-roles
You can ask the project owner what role you have on the project (unless you are a project Owner, Editor or Viewer, in which case you can see your role on the Permissions page).

I also got this error. It seems you need to be Project Owner to be able to create App Engine applications.

You need to have the App Engine API enabled.You need to have the app engine deployer or admin role. And you need to be the project Owner, not just the project editor.
See: https://cloud.google.com/appengine/docs/admin-api/access-control
apps.create appengine.applications.create on the requested Application resource. Requires Owner role permissions on GCP project.

Related

gcloud app deploy Required 'compute.regions.get' permission for Owner Principal

$ gcloud app deploy MY.yaml --image-url gcr.io/vorburger-learn-appengin/image:develop
causes the following error for me:
ERROR: (gcloud.app.deploy) PERMISSION_DENIED: Request to https://compute.googleapis.com/compute/v1/projects/projects/vorburger-learn-appengin/regions/europe-west1?key failed, details: Required 'compute.regions.get' permission for 'projects/vorburger-learn-appengin/regions/europe-west1'
I'm simply running gcloud locally after gcloud init for my #gmail.com account, who has the omnipotent IAM Owner role on that GCP project. So it's not clear to me just which IAM Principal is missing the compute.regions.get permission?
This is on a project where it used to work last year and stopped working 2 months ago. Maybe I deleted something by mistake? Things I've tried out so far:
gcloud services enable appengineflex.googleapis.com mentioned here
Verified #cloudservices.gserviceaccount.com Google APIs Service Agent exists and has the Editor role mentioned here
I do NOT have any 123...-compute#developer.gserviceaccount.com account mentioned here on this project - should I?
Background: https://github.com/vorburger/www.fineract.dev/issues/15
I do NOT have any 123...-compute#developer.gserviceaccount.com account mentioned here on this project - should I?
Yes, you have to undelete the service account. However, the undelete command only works for Service Accounts deleted fewer than 30 days ago.
After 30 days, IAM permanently removes the service account. Google Cloud cannot recover the service account after it is permanently removed, even if you file a support request.
If you are not able to undelete the service account, you can create a new service account with the same name; revoke all of the roles from the deleted service account; and grant the same roles to the new service account. For details, see Policies with deleted principals.
Additionally, you did not mention the App Engine default service account if it was also accidentally deleted. If yes, you would also need to undelete this.
Warning: Deleting the App Engine default service account breaks any current and future App Engine applications in your Cloud project. For example, your application will lose access to other Google Cloud services such as Datastore. If needed, you can restore a deleted default service account.

Cloud Build fails to deploy to Google App Engine - You do not have permission to act as #appspot.gserviceaccount.com

This morning I made a PR which triggered a Cloud Build for my staging enviroment but failed to deploy the results to GAE.
The error was as follows:
ERROR: (gcloud.app.deploy) PERMISSION_DENIED: You do not have permission to act as '[redacted]#appspot.gserviceaccount.com'
Step #4: - '#type': type.googleapis.com/google.rpc.ResourceInfo
Step #4: description: You do not have permission to act as this service account.
Step #4: resourceName: [redacted]#appspot.gserviceaccount.com
Step #4: resourceType: serviceAccount
When I look at https://console.cloud.google.com/cloud-build/settings/service-account
Cloud build has the follow service account permissions ENABLED:
App Engine Admin
Cloud KMS
Checking https://console.cloud.google.com/iam-admin/iam
I can see that the cloudbuild service account has the following roles:
App Engine Admin
App Engine Deployer
Cloud Build Service Account
Cloud KMS CryptoKey Decrypter
According to the provided error, it seems like you need to add some delegation to your service account. This means that the service account can act on behalf of another service account. Do not add this permission on the project level, since it poses a security risk! Below you can find an example of how to add roles/iam.serviceAccountUser on another service account.
PROJECT_ID=xxxxxx
PROJECT_NUMBER=$(gcloud projects list \
--format="value(projectNumber)" \
--filter="projectId=${PROJECT_ID}")
gcloud iam service-accounts add-iam-policy-binding \
${PROJECT_ID}#appspot.gserviceaccount.com \
--member=serviceAccount:${PROJECT_NUMBER}#cloudbuild.gserviceaccount.com \
--role=roles/iam.serviceAccountUser \
--project=${PROJECT_ID}
To summarize, the service account must have the iam.serviceAccounts.actAs permission, which is included in the roles/iam.serviceAccountUser role. Updated Google documentation can be found here.
I had the same issue. For me I had to add the Service Account User role to my circle ci user in IAM. Maybe you can do the same for cloudbuild.
First we go to the permission manager and select the project that we want to add permissions.; https://console.cloud.google.com/iam-admin/
I grant Service Account User permission to my CI/CD service account. That works.
Screenshot of IAM
Screenshot of my Gitlab CI/CD configuration
To resolve this issue, you can add Service Account User IAM permission to your CI/CD pipeline service account.
Eg. If you're using Cloud Build, then add Service Account User role to your {project-number}#cloudbuild.gserviceaccount.com service account
It looks as though this question is answered with the .ActAs permission being added to the Gitlab or CircleCI account.
I haven't had occasion to test yet - if anyone else has and can post details - please do so;
This is the proposed answer from what I can gather:
How do you enable "iam.serviceAccounts.actAs" permissions on a sevice account?
Nebulastic has a very nice answer above but the {PROJECT_ID} would need to be swapped with the Gitlab or CircleCI account name, not the project named account.

How can I add an user to existing Google App Engine project?

I have an App Engine project to which I want to add another user, so she will have access to see it and also deploy to it.
I've tried to add her in IAM but she doesn't see the project.
If you want to grant her deploy permissions, you should grant her, at least, App Engine Deployer in IAM. You may need to grant also the Storage Admin role if that person is planning on using gcloud commands, which is most likely for deployments.

How to give a developer access to my Google App Engine project?

I've got a Google App Engine project account and want to give access to a new developer who's going to help out, but I don't want him to have the account access details. How do I add him as a user so he can deploy and test code on my account (locally on his machine using the SDK and live), but not do anything I don't want him to do with the account?
I know I need to use IAM roles somehow, but does the developer already need a Google account (don't think he has one) or can I just send an invite to his existing email etc?
Many thanks,
Alex
Your developer will require a Google account, which can be a gmail account or a Google Apps account.
Check out the description of the App Engine IAM roles and then grant the appropriate access to your developer's Google account.
In your case that might be either "Editor" or "App Engine Service Admin".

Google Appengine: admin access

We are using Google AppEngine for my site. Unfortunately I can't seem to get full owner admin access even though I am supposed to be a Super Admin according to my Google account.
When I go to Google Appengine (https://appengine.google.com/permissions....) using my Google account, it indicates I am a "developer". I believe I need full owner access in order to upload ssl certificate for the domain plus add or edit the permission. I've called Google support and they wash their hands saying the above is outside their core knowledge. Any suggestions would be most welcome.
Google Apps admin status does not give you "owner" status on AppEngine. Owner of the AppEngine app has to go to the "Permissions" tab in GAE console and grant you this status.

Resources