3

I am trying to use API Gateway, and I am not able to enable the apigateway.googleapis.com API. It is not shown in gcloud services list. I am trying to follow the instruction of gcp doc. https://cloud.google.com/api-gateway/docs/configure-dev-env#enabling_required_services

When trying to enable it in console, it does not return anything.

When trying to enable it in gcloud, it returns error as follows. gcloud services enable apigateway.googleapis.com ERROR: (gcloud.services.enable) PERMISSION_DENIED: The caller does not have permission

I was not able to attach a role since I was not able to find which role is related to apigateway. I could not create custom role since there was no related policy.

Is there any way I can resolve this issue?

Jofre
  • 3,718
  • 1
  • 23
  • 31
ver1cks
  • 33
  • 1
  • 4

1 Answers1

3

To enable "API Gateway API" you need at least one of roles listed below:

  • Owner
  • Editor
  • Service Config Editor

Next to enable the service you need to run:

gcloud services enable apigateway.googleapis.com
gcloud services enable servicemanagement.googleapis.com
gcloud services enable servicecontrol.googleapis.com

And the output should look somewhat like this:

wb@cloudshell:~ (wojtek)$ gcloud services enable apigateway.googleapis.com
Operation "operations/acf.f02abf75-b8c8-xxxx-b639-d1e69ed2c4c5" finished successfully.

wb@cloudshell:~ (wojtek)$ gcloud services enable servicemanagement.googleapis.com
Operation "operations/acf.faab3e15-7eb2-xxxx-8b34-2073f7f3518f" finished successfully.

wb@cloudshell:~ (wojtek)$ gcloud services enable servicecontrol.googleapis.com
Operation "operations/acf.faab3e15-7eb2-xxxx-8b34-2073f7f3518f" finished successfully.
Wojtek_B
  • 4,245
  • 1
  • 7
  • 21
  • Thanks a lot! Actually, I already had Owner for my service account, but I succeeded after adding 'Service Config Editor'. It returns 'No change - member already exists on the policy' but it works. – ver1cks Sep 08 '20 at 17:53