is it possible to restrict access to GCS bucket from GCP load balancer only?

240 Views Asked by At

I've successfully deployed a static website on a Google Cloud Storage bucket and configured it as the backend for an external application load balancer within Google Cloud Platform. I'm now seeking a way to restrict access to the GCS bucket, allowing only the GCP load balancer to reach it.

1

There are 1 best solutions below

5
Sai Chandini Routhu On

I agreed with what @JohnHanley said.

Consider your reasons for wanting to restrict access and have the user go through a load balancer. That will raise expenses and potentially reduce performance (cache refresh, etc.).

Cloud storage is extremely reliable and resistant to errors. Sometimes it makes sense to use Cloud CDN just make sure you've looked over your choices.

As per this official doc

You must add the Cloud CDN service account to Cloud Storage ACLs in order to grant Cloud CDN permission to read the objects if you utilize Cloud Storage and have restricted who can read them.

The creation of the service account is not required. When you add a key to a backend bucket in a project for the first time, the service account is automatically established.

Refer to this official doc for cloud CDN Pricing

you can also use media cdn to prevent unauthorized access

For more information refer to this gitlink