Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how to access file in GCS private bucket

I had created a private bucket, and I uploaded dist folder to access javascript file, I dont want to make the bucket public by adding allUsers and allAuthenticatedUsers, I had added load balancer and given Network admin and storage Admin access, when i am trying to hit loadbalancer still showing an error access denied, how can access the file can anyone help me 

0 3 2,640
3 REPLIES 3

A load balancer will proxy the users request through to the storage bucket and in order to read the contents the entity making the request needs the required access. So if you want the objects to be readable by everyone via the load balancer you will still need to permit "allUsers".  Are you able to elaborate on what you are trying to achieve?

I am trying to deploy Single-spa micro-frontend, our organization not permitting to use public bucket, I deployed micro-frontend service dist folders in GCS private bucket, I am not able to hit the service using load balancer it is showing access denied and even CORS is not allowing storage.cloud.google.com url. I want to know how to do a static website hosting in a private bucket in GCP for Single-spa micro-frontend application.

 

If you want the bucket to be private, you will need to consider some kind of proxy solution - there is a community article on this subject here which might be of use: https://cloud.google.com/community/tutorials/cloud-run-golang-gcs-proxy