DEV Community

David Haley
David Haley

Posted on

Ensuring GCE instances have full access to GCP APIs

The default settings for GCE instances are fairly locked down from accessing Google APIs, but it's not obvious that's happening!

Check out the instance creation settings:

Screenshot of the Identity and API access settings

You might think that "allow default access" means "use normal permissions as already configured". But … no 😅 Hover over the "?" icon and see:

Default: read-only access to Storage and Service Management, write access to Stackdriver Logging and Monitoring, read/write access to Service Control.

In other words, creating a GCE instance with default settings means you can't write to storage even if the default service account has write permissions.

You have two options:

  • Go with full access according to permissions: Allow full access to all Cloud APIs

  • Customize each service: Set access for each API

I went with the former, as I'm ok relying on the service account permissions. It's nice to know a more secure environment could lock down the account to just what's needed for that particular case (vs everything the account can do).

🔐

After this change, I can create VMs that can read/write storage. Ahh 😌

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay